Set shellredir on Windows
Prep to use list type for command passed to s:system() within s:spawn()
This commit is contained in:
parent
ba7ddedb9a
commit
d9f7328268
11
plug.vim
11
plug.vim
|
@ -864,8 +864,15 @@ endfunction
|
||||||
|
|
||||||
function! s:chsh(swap)
|
function! s:chsh(swap)
|
||||||
let prev = [&shell, &shellcmdflag, &shellredir]
|
let prev = [&shell, &shellcmdflag, &shellredir]
|
||||||
if !s:is_win && a:swap
|
if !s:is_win
|
||||||
set shell=sh shellredir=>%s\ 2>&1
|
set shell=sh
|
||||||
|
endif
|
||||||
|
if a:swap
|
||||||
|
if &shell =~# 'powershell\.exe' || &shell =~# 'pwsh$'
|
||||||
|
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s'
|
||||||
|
elseif &shell =~# 'sh' || &shell =~# 'cmd\.exe'
|
||||||
|
set shellredir=>%s\ 2>&1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
return prev
|
return prev
|
||||||
endfunction
|
endfunction
|
||||||
|
|
Loading…
Reference in New Issue
Block a user