From 131aad953c007d382cbff1d2560471b29975da87 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 30 Sep 2017 21:31:31 -0400 Subject: win: defaults: 'shellcmdflag', 'shellxquote' #7343 closes #7698 Wrapping a command in double-quotes allows cmd.exe to safely dequote the entire command as if the user entered the entire command in an interactive prompt. This reduces the need to escape nested and uneven double quotes. The `/s` flag of cmd.exe makes the behaviour more reliable: :set shellcmdflag=/s\ /c Before this patch, cmd.exe cannot use cygwin echo.exe (as opposed to cmd.exe `echo` builtin) even if it is wrapped in double quotes. Example: :: internal echo > cmd /s /c " echo foo\:bar" " foo\:bar" :: cygwin echo.exe > cmd /s /c " "echo" foo\:bar" " foo:bar --- runtime/doc/options.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 9ef5ccb5c5..f4bf49c7c5 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5160,10 +5160,10 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'shellcmdflag'* *'shcf'* -'shellcmdflag' 'shcf' string (default: "-c"; Windows: "/c") +'shellcmdflag' 'shcf' string (default: "-c"; Windows: "/s /c") global Flag passed to the shell to execute "!" and ":!" commands; e.g., - "bash.exe -c ls" or "cmd.exe /c dir". For Windows + `bash.exe -c ls` or `cmd.exe /s /c "dir"`. For Windows systems, the default is set according to the value of 'shell', to reduce the need to set this option by the user. On Unix it can have more than one flag. Each white space separated @@ -5284,7 +5284,7 @@ A jump table for the options with a short description can be found at |Q_op|. to execute most external commands with cmd.exe. *'shellxquote'* *'sxq'* -'shellxquote' 'sxq' string (default: "") +'shellxquote' 'sxq' string (default: "", Windows: "\"") global Quoting character(s), put around the command passed to the shell, for the "!" and ":!" commands. Includes the redirection. See -- cgit