-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Job failure when testing connection to remote #157
Comments
Could you please provide a minimal reproducible example for this? |
As mentioned in #155 the issue is the result of a call to Running the following commands directly from terminal give the following outputs:
|
Fixed an issue with `run_command("echo 'Hello'")` where wrapping commands in args in single quotes caused invalid parsing in POSIX-compliant shells. In these shells, single quotes enclose literal text, making escape sequences like `\'` invalid. For more details, refer to the GNU Bash manual: https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html. For example, calling `run_command("echo 'Hello'")` would be incorrectly escaped by `vim.fn.shellescape` as `echo '\''Hello'\''`, leading to invalid parsing. The fix replaces the outer double quotes with single quotes where necessary and command arg with double qoute, ensuring proper escaping and compatibility across different shell environments. Signed-off-by: Daniel Temiagin <[email protected]>
The issue arises when calling run_command("echo 'Hello'"). The problem is in how shellescape escapes the command output. Specifically, it incorrectly wraps the argument in single quotes escaping the single qoute, causing issues when executing the command. |
I came across the above problem while trying to debug my main machine which fails on the
echo 'Hello'
check with the following output:Which uses OpenSSH_9.8, but since I am going from a NixOS machine to a docker container, there are more than a few moving parts to investigate along the lines of #150 before I feel comfortable opening a new issue. If you have any ideas what might be causing this please let me know!
Originally posted by @TakodaS in #147 (comment)
The text was updated successfully, but these errors were encountered: