diff options
author | Enan Ajmain <3nan.ajmain@gmail.com> | 2021-11-09 20:22:21 +0600 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2022-06-25 07:20:58 -0700 |
commit | 0b9664f5240be4d9e9d6882fcd398970fd3a9532 (patch) | |
tree | e02103f3cfd37f6c313c096a41c0d660ea6ebaf2 /test/functional/vimscript/system_spec.lua | |
parent | b7084fef4c850d0352488b14dcff0f36a7e75e1c (diff) | |
download | rneovim-0b9664f5240be4d9e9d6882fcd398970fd3a9532.tar.gz rneovim-0b9664f5240be4d9e9d6882fcd398970fd3a9532.tar.bz2 rneovim-0b9664f5240be4d9e9d6882fcd398970fd3a9532.zip |
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
Diffstat (limited to 'test/functional/vimscript/system_spec.lua')
-rw-r--r-- | test/functional/vimscript/system_spec.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua index 9cc6424d31..dd1ac694e7 100644 --- a/test/functional/vimscript/system_spec.lua +++ b/test/functional/vimscript/system_spec.lua @@ -6,6 +6,8 @@ local eq, call, clear, eval, feed_command, feed, nvim = helpers.eq, helpers.call, helpers.clear, helpers.eval, helpers.feed_command, helpers.feed, helpers.nvim local command = helpers.command +local insert = helpers.insert +local expect = helpers.expect local exc_exec = helpers.exc_exec local iswin = helpers.iswin local os_kill = helpers.os_kill @@ -630,3 +632,29 @@ describe('systemlist()', function() end) end) + +it(':{range}! works with powershell for filter and redirection #16271', function() + clear() + if not helpers.has_powershell() then + pending("not tested; powershell was not found", function() end) + return + end + local screen = Screen.new(500, 8) + screen:attach() + helpers.set_shell_powershell() + insert([[ + 3 + 1 + 4 + 2]]) + feed(':4verbose %!sort<cr>') + screen:expect{ + any=[[Executing command: "Start%-Process sort %-RedirectStandardInput .* %-RedirectStandardOutput .* %-NoNewWindow %-Wait".*4 lines filtered.*Press ENTER or type command to continue]] + } + feed('<CR>') + expect([[ + 1 + 2 + 3 + 4]]) +end) |