aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
diff options
context:
space:
mode:
authortao <2471314@gmail.com>2026-06-11 05:28:17 +0800
committerGitHub <noreply@github.com>2026-06-10 17:28:17 -0400
commitb49492f13ce34c242546e5a3e768b2937ebddeba (patch)
tree9aab9a4bc4ca613f9acc466a87357f6cf598945b /runtime/lua
parent2899e350ff06833af0d53baba31800a32dcea696 (diff)
downloadrneovim-b49492f13ce34c242546e5a3e768b2937ebddeba.tar.gz
rneovim-b49492f13ce34c242546e5a3e768b2937ebddeba.tar.bz2
rneovim-b49492f13ce34c242546e5a3e768b2937ebddeba.zip
fix(option): set 'shell…' options based on detected shell #40031
Problem: * 'shellcmdflag' states that its default value is set according to the value of 'shell', but this behavior is not yet implemented on Windows. The same applies to 'shellpipe', 'shellredir', and 'shellxquote'. * On Windows, Git is often installed in paths containing spaces, and we still do not correctly resolve the sh executable name as described in 'shell'. * On Windows, the default value of 'shellslash' is always `false`, which causes Unix-like shells to interpret `\` in paths returned by some functions as escape charaters. Solution: Use a simple rule table to detect common shells (e.g. `cmd`, `powershell`, shells whose names contain `csh` or `sh`) and apply best-effort defaults, while leaving more complex scenarios to user configuration.
Diffstat (limited to 'runtime/lua')
-rw-r--r--runtime/lua/vim/_meta/options.gen.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/runtime/lua/vim/_meta/options.gen.lua b/runtime/lua/vim/_meta/options.gen.lua
index 3e2e24e7fc..0895207bd2 100644
--- a/runtime/lua/vim/_meta/options.gen.lua
+++ b/runtime/lua/vim/_meta/options.gen.lua
@@ -5914,12 +5914,12 @@ vim.go.shcf = vim.go.shellcmdflag
--- For MS-Windows the default is "2>&1| tee". The stdout and stderr are
--- saved in a file and echoed to the screen.
--- For Unix the default is "| tee". The stdout of the compiler is saved
---- in a file and echoed to the screen. If the 'shell' option is "csh" or
---- "tcsh" after initializations, the default becomes "|& tee". If the
---- 'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta",
---- "bash", "fish", "ash" or "dash" the default becomes "2>&1| tee". This
---- means that stderr is also included. Before using the 'shell' option a
---- path is removed, thus "/bin/sh" uses "sh".
+--- in a file and echoed to the screen. If the 'shell' option contains
+--- "csh" (e.g. "tcsh") after initializations, the default becomes
+--- "|& tee". Otherwise, if it contains "sh" (e.g. "bash", "zsh"), the
+--- default becomes "2>&1| tee". This means that stderr is also included.
+--- Before using the 'shell' option a path is removed, thus "/bin/sh" uses
+--- "sh".
--- The initialization of this option is done after reading the vimrc
--- and the other initializations, so that when the 'shell' option is set
--- there, the 'shellpipe' option changes automatically, unless it was
@@ -5964,12 +5964,12 @@ vim.go.shq = vim.go.shellquote
--- The name of the temporary file can be represented by "%s" if necessary
--- (the file name is appended automatically if no %s appears in the value
--- of this option).
---- The default is ">". For Unix, if the 'shell' option is "csh" or
---- "tcsh" during initializations, the default becomes ">&". If the
---- 'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta",
---- "bash" or "fish", the default becomes ">%s 2>&1". This means that
---- stderr is also included. For Win32, the Unix checks are done and
---- additionally "cmd" is checked for, which makes the default ">%s 2>&1".
+--- The default is ">". For Unix, if the 'shell' option contains "csh"
+--- (e.g. "tcsh") during initializations, the default becomes ">&".
+--- Otherwise, if it contains "sh" (e.g. "bash", "zsh"), the default
+--- becomes ">%s 2>&1". This means that stderr is also included. For
+--- Win32, the Unix checks are done and additionally "cmd" is checked
+--- for, which makes the default ">%s 2>&1".
--- Also, the same names with ".exe" appended are checked for.
--- The initialization of this option is done after reading the vimrc
--- and the other initializations, so that when the 'shell' option is set