mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
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`
(cherry picked from commit b4d42bb905
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
9e784a53b4
commit
bb9c5c3f60
@@ -5357,7 +5357,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
To use PowerShell: >
|
||||
let &shell = executable('pwsh') ? 'pwsh' : 'powershell'
|
||||
let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
|
||||
let &shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
|
||||
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
||||
let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
||||
set shellquote= shellxquote=
|
||||
|
||||
|
Reference in New Issue
Block a user