diff options
author | Rui Abreu Ferreira <rap-ep@gmx.com> | 2017-03-30 23:41:52 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-04-12 02:10:34 +0200 |
commit | d31d177a0c2c9997c2cdb04975bc3354b9a23fb8 (patch) | |
tree | 75dbeb01938301ef572ac83c7191246ba8b6fd34 /runtime/doc/options.txt | |
parent | f3cc843755a6d638ada77dc31721aa53b3ff2364 (diff) | |
download | rneovim-d31d177a0c2c9997c2cdb04975bc3354b9a23fb8.tar.gz rneovim-d31d177a0c2c9997c2cdb04975bc3354b9a23fb8.tar.bz2 rneovim-d31d177a0c2c9997c2cdb04975bc3354b9a23fb8.zip |
win: default shellxescape, shellxquote to empty
Calling cmd.exe in Windows follows a very different pattern from Vim.
The primary difference is that Vim does a nested call to cmd.exe, e.g.
the following call in Vim
system('echo a 2>&1')
spawns the following processes
"C:\Program Files (x86)\Vim\vim80\vimrun" -s C:\Windows\system32\cmd.exe /c (echo a 2^>^&1
^>C:\Users\dummy\AppData\Local\Temp\VIoC169.tmp 2^>^&1)
C:\Windows\system32\cmd.exe /c C:\Windows\system32\cmd.exe /c (echo a 2^>^&1
^>C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2^>^&1)
C:\Windows\system32\cmd.exe /c (echo a 2>&1
>C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2>&1)
The escaping with ^ is needed because cmd.exe calls itself and needs to
preserve the special metacharacters for the last call. However in nvim
no nested call is made, system('') spawns a single cmd.exe process.
Setting shellxescape to "" disables escaping with ^.
The previous default for shellxquote=( wrapped any command in
parenthesis, in Vim this is more meaningful due to the use of tempfiles
to store the output and redirection (also see &shellquote). There is
a slight benefit in having the default be empty because some expressions
that run in console will not run within parens e.g. due to unbalanced
double quotes
system('echo "a b')
Diffstat (limited to 'runtime/doc/options.txt')
-rw-r--r-- | runtime/doc/options.txt | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 42d665b42e..9be7dae84d 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5365,18 +5365,14 @@ A jump table for the options with a short description can be found at |Q_op|. |system()| does not respect this option, it always uses pipes. *'shellxescape'* *'sxe'* -'shellxescape' 'sxe' string (default: ""; Windows: "\"&|<>()@^") +'shellxescape' 'sxe' string (default: "") global When 'shellxquote' is set to "(" then the characters listed in this option will be escaped with a '^' character. This makes it possible to execute most external commands with cmd.exe. *'shellxquote'* *'sxq'* -'shellxquote' 'sxq' string (default: ""; - for Win32, when 'shell' is cmd.exe: "(" - for Win32, when 'shell' contains "sh" - somewhere: "\"" - for Unix, when using system(): "\"") +'shellxquote' 'sxq' string (default: "") global Quoting character(s), put around the command passed to the shell, for the "!" and ":!" commands. Includes the redirection. See @@ -5385,12 +5381,6 @@ A jump table for the options with a short description can be found at |Q_op|. When the value is '(' then ')' is appended. When the value is '"(' then ')"' is appended. When the value is '(' then also see 'shellxescape'. - This is an empty string by default on most systems, but is known to be - useful for on Win32 version, either for cmd.exe which automatically - strips off the first and last quote on a command, or 3rd-party shells - such as the MKS Korn Shell or bash, where it should be "\"". The - default is adjusted according the value of 'shell', to reduce the need - to set this option by the user. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. |