diff options
author | Dimitri Tcaciuc <dtcaciuc@users.noreply.github.com> | 2021-07-02 05:15:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-02 08:15:40 -0400 |
commit | 8b0765390292961aa0ec22e9931885c6d947c5e6 (patch) | |
tree | 42ae5afac31f865b16cce6c63c4b7d1628c86811 /test/functional/helpers.lua | |
parent | 7d8202087bed0a0baefb61557fcea15087fb01b3 (diff) | |
download | rneovim-8b0765390292961aa0ec22e9931885c6d947c5e6.tar.gz rneovim-8b0765390292961aa0ec22e9931885c6d947c5e6.tar.bz2 rneovim-8b0765390292961aa0ec22e9931885c6d947c5e6.zip |
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
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 |