diff options
author | Enan Ajmain <3nan.ajmain@gmail.com> | 2023-03-20 03:25:12 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-19 14:25:12 -0700 |
commit | ecc4d0e435d618828b938d78fbded7fbe1314760 (patch) | |
tree | 777d1989517b013252a3c577f3e22246f1bf2746 /runtime/doc/options.txt | |
parent | 5726f33e8caaa5967c4ae93972a9eaec0b9c0c82 (diff) | |
download | rneovim-ecc4d0e435d618828b938d78fbded7fbe1314760.tar.gz rneovim-ecc4d0e435d618828b938d78fbded7fbe1314760.tar.bz2 rneovim-ecc4d0e435d618828b938d78fbded7fbe1314760.zip |
fix(shell): on Windows :make does not echo #22728
Problem:
On Windows, :make does not display the output of the program it runs.
The cause is the default 'shellpipe'. On Linux, nvim uses `tee` to redirect the
output to both stdout and the error file. In Windows, for both cmd.exe and
powershell, the output is only redirected to the error file.
Solution:
- On Windows, change the 'shellpipe' default to "2>&1| tee".
- Nvim includes `tee` in its Windows package.
- Document recommended defaults for powershell.
Fixes #12910
Diffstat (limited to 'runtime/doc/options.txt')
-rw-r--r-- | runtime/doc/options.txt | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 9fff5228f2..36c02fa3cb 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5235,9 +5235,9 @@ A jump table for the options with a short description can be found at |Q_op|. *shell-powershell* To use PowerShell: > let &shell = executable('pwsh') ? 'pwsh' : 'powershell' - let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;' - let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode' - let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode' + let &shellcmdflag = '-NoLogo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues[''Out-File:Encoding'']=''utf8'';' + let &shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode' + let &shellpipe = '2>&1 | %%{ "$_" } | Tee-Object %s; exit $LastExitCode' set shellquote= shellxquote= < This option cannot be set from a |modeline| or in the |sandbox|, for @@ -5259,8 +5259,7 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'shellpipe'* *'sp'* -'shellpipe' 'sp' string (default ">", ">%s 2>&1", "| tee", "|& tee" or - "2>&1| tee") +'shellpipe' 'sp' string (default ">", "| tee", "|& tee" or "2>&1| tee") global String to be used to put the output of the ":make" command in the error file. See also |:make_makeprg|. See |option-backslash| about @@ -5268,8 +5267,8 @@ A jump table for the options with a short description can be found at |Q_op|. 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). - For MS-Windows the default is ">%s 2>&1". The output is directly - saved in a file and not echoed to the screen. + 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 |