diff options
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 91c2364a72..03ef441ef3 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -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 |