mirror of
https://github.com/neovim/neovim.git
synced 2026-07-17 14:41:33 +00:00
fix: make_filter_cmd for :! powershell #15913
Problem:
Nvim fails to create tempfile "…/nvim6UJx04/7" when 'shell' is set to
pwsh (PowerShell Core). This breaks filtered shell commands ":{range}!".
With shell set to cmd, it works.
Solution:
PowerShell doesn't use "<" for stdin redirection. Instead, use
"-RedirectStandardInput".
Closes #15913
This commit is contained in:
committed by
Christian Clason
parent
790f6089e9
commit
175892fa37
@@ -511,9 +511,9 @@ function module.set_shell_powershell()
|
||||
module.exec([[
|
||||
let &shell = ']]..shell..[['
|
||||
set shellquote= shellxquote=
|
||||
let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
||||
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
||||
let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command ]]..cmd..[['
|
||||
let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
||||
let &shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
|
||||
]])
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user