mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
doc(options): Fix recommended PowerShell config (#14349)
Ensure that * Shell uses UTF8 input/output mode * Stderr output is captured, in UTF8 * Program exit codes are correctly captured Update functional test harness and add tests for :make command. Closes #13713
This commit is contained in:
@@ -513,13 +513,15 @@ end
|
||||
function module.set_shell_powershell()
|
||||
local shell = iswin() and 'powershell' or 'pwsh'
|
||||
assert(module.has_powershell())
|
||||
local cmd = 'Remove-Item -Force '..table.concat(iswin()
|
||||
local set_encoding = '[Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
|
||||
local cmd = set_encoding..'Remove-Item -Force '..table.concat(iswin()
|
||||
and {'alias:cat', 'alias:echo', 'alias:sleep'}
|
||||
or {'alias:echo'}, ',')..';'
|
||||
module.source([[
|
||||
let &shell = ']]..shell..[['
|
||||
set shellquote= shellpipe=\| shellxquote=
|
||||
let &shellredir = '| Out-File -Encoding UTF8'
|
||||
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..[['
|
||||
]])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user