Fix escaping issue for shell commands #401
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am using
overseer.nvimin conjunction withcmake-tools.nvim.In
cmake-toolsI defined a task as{ cmake_command = "source /home/ubuntu/setup.sh && cmake", -- I am doing cross compilation and need specific $PATH and such cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1", "-GNinja", " -DCMAKE_C_COMPILER_LAUNCHER=ccache", "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache" } }from which
cmake-tasksconstructs anoverseertask, so far so good. However, the following command gets escaped by overseer, and ends up being sent to the shell (bash) aswhich obviously does not work: the command is escaped out between single quotes
'...'.A simple way to simulate this failure is to run
bash -c "'echo test1' && echo test2"in a terminal, which givesbash: line 1: echo test1: command not foundThe patch in this PR removes escaping of the command, and leaves it for the arguments. This works in this case, but I am unsure if it might break other use cases.