diff options
author | Jack Bracewell <jack.bracewell@unboxedconsulting.com> | 2016-03-29 13:47:30 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-03-17 17:47:33 +0100 |
commit | 2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec (patch) | |
tree | b0d34745e7573d285340fdf147d9afcf098fb096 /src/nvim/os/shell.c | |
parent | 0c1f7831649e92b6904ca580ee90acd6ba89d1a8 (diff) | |
download | rneovim-2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec.tar.gz rneovim-2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec.tar.bz2 rneovim-2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec.zip |
terminal: Support extra arguments in 'shell'. #4504
Tokenize p_sh if used as default in ex_terminal(). Previously p_sh was
used as the first arg in a list when calling termopen(), this would try
to call an untokenized version of shell, meaning if you had an argument
in 'shell':
set shell=/bin/bash\ --login
the command would fail.
Helped-by: oni-link <knil.ino@gmail.com>
Closes #3999
Diffstat (limited to 'src/nvim/os/shell.c')
-rw-r--r-- | src/nvim/os/shell.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index a5fd37ed5c..b449cc3d5a 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -39,12 +39,13 @@ typedef struct { #endif /// Builds the argument vector for running the user-configured 'shell' (p_sh) -/// with an optional command prefixed by 'shellcmdflag' (p_shcf). +/// with an optional command prefixed by 'shellcmdflag' (p_shcf). E.g.: +/// +/// ["shell", "-extra_args", "-shellcmdflag", "command with spaces"] /// /// @param cmd Command string, or NULL to run an interactive shell. /// @param extra_args Extra arguments to the shell, or NULL. -/// @return A newly allocated argument vector. It must be freed with -/// `shell_free_argv` when no longer needed. +/// @return Newly allocated argument vector. Must be freed with shell_free_argv. char **shell_build_argv(const char *cmd, const char *extra_args) FUNC_ATTR_NONNULL_RET FUNC_ATTR_MALLOC { |