aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/system_spec.lua
diff options
context:
space:
mode:
authorEnan Ajmain <3nan.ajmain@gmail.com>2022-07-20 01:43:26 +0600
committerEnan Ajmain <3nan.ajmain@gmail.com>2022-09-30 21:07:45 +0600
commitb4d42bb9058308c38e3fe9d59458ce65b3f65eb0 (patch)
tree1a36a320f2a3498c8022e416478bf2e9b56e9c0a /test/functional/vimscript/system_spec.lua
parentad6af3c1a96f9fae0881c3dcb1f1989531a1073e (diff)
downloadrneovim-b4d42bb9058308c38e3fe9d59458ce65b3f65eb0.tar.gz
rneovim-b4d42bb9058308c38e3fe9d59458ce65b3f65eb0.tar.bz2
rneovim-b4d42bb9058308c38e3fe9d59458ce65b3f65eb0.zip
fix: make_filter_cmd for :! powershell
Problem: `Start-Process` requires the command to be split into the shell command and its arguments. Previously it was done by parsing, which didn't handle cases such as - commands with escaped space in their filepath - quoted commands with space in their filepath Solution: Use - `pwsh -Command` instead of `Start-Process` - `Get-Content` instead of `-RedirectStandardInput` - `Out-File` instead of `-RedirectStandardOutput`
Diffstat (limited to 'test/functional/vimscript/system_spec.lua')
-rw-r--r--test/functional/vimscript/system_spec.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua
index a778e2f435..d0061d051e 100644
--- a/test/functional/vimscript/system_spec.lua
+++ b/test/functional/vimscript/system_spec.lua
@@ -642,12 +642,12 @@ describe('shell :!', function()
if iswin() then
feed(':4verbose %!sort /R<cr>')
screen:expect{
- any=[[Executing command: .?Start%-Process sort %-ArgumentList "/R" %-RedirectStandardInput .* %-RedirectStandardOutput .* %-NoNewWindow %-Wait]]
+ any=[[Executing command: .?Get%-Content .* | & sort /R 2>&1 | Out%-File %-Encoding UTF8 .*; exit $LastExitCode]]
}
else
feed(':4verbose %!sort -r<cr>')
screen:expect{
- any=[[Executing command: .?Start%-Process sort %-ArgumentList "%-r" %-RedirectStandardInput .* %-RedirectStandardOutput .* %-NoNewWindow %-Wait]]
+ any=[[Executing command: .?Get%-Content .* | & sort %-r 2>&1 | Out%-File %-Encoding UTF8 .*; exit $LastExitCode]]
}
end
feed('<CR>')