mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 19:43:47 -05:00
Force cmd.exe to be used by system() instead of pwsh or powershell on Windows
This commit is contained in:
@@ -176,15 +176,20 @@ endfunction
|
|||||||
|
|
||||||
function! s:use_known_shell() abort
|
function! s:use_known_shell() abort
|
||||||
if has('unix') && &shell !=# 'sh'
|
if has('unix') && &shell !=# 'sh'
|
||||||
let [s:shell, s:shellcmdflag, s:shellredir] = [&shell, &shellcmdflag, &shellredir]
|
let [s:shell, s:shellcmdflag, s:shellredir, s:shellpipe, s:shellquote, s:shellxquote] = [&shell, &shellcmdflag, &shellredir, &shellpipe, &shellquote, &shellxquote]
|
||||||
let &shell = 'sh'
|
let &shell = 'sh'
|
||||||
set shellcmdflag=-c shellredir=>%s\ 2>&1
|
set shellcmdflag=-c shellredir=>%s\ 2>&1
|
||||||
endif
|
endif
|
||||||
|
if has('win32') && (&shell ==# 'pwsh' || &shell ==# 'powershell')
|
||||||
|
let [s:shell, s:shellcmdflag, s:shellredir, s:shellpipe, s:shellquote, s:shellxquote] = [&shell, &shellcmdflag, &shellredir, &shellpipe, &shellquote, &shellxquote]
|
||||||
|
let &shell = 'cmd.exe'
|
||||||
|
set shellcmdflag=/s\ /c shellredir=>%s\ 2>&1 shellpipe=>%s\ 2>&1 shellquote= shellxquote="
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:restore_shell() abort
|
function! s:restore_shell() abort
|
||||||
if has('unix') && exists('s:shell')
|
if (has('unix') || has('win32')) && exists('s:shell')
|
||||||
let [&shell, &shellcmdflag, &shellredir] = [s:shell, s:shellcmdflag, s:shellredir]
|
let [&shell, &shellcmdflag, &shellredir, &shellpipe, &shellquote, &shellxquote] = [s:shell, s:shellcmdflag, s:shellredir, s:shellpipe, s:shellquote, s:shellxquote]
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user