Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preserve shellcmdflag and normalize for /bin/sh #2006

Merged
merged 1 commit into from
Oct 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions autoload/go/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,13 @@ endfunction
" so that we always use a standard POSIX-compatible Bourne shell (and not e.g.
" csh, fish, etc.) See #988 and #1276.
function! s:system(cmd, ...) abort
" Preserve original shell and shellredir values
" Preserve original shell, shellredir and shellcmdflag values
let l:shell = &shell
let l:shellredir = &shellredir
let l:shellcmdflag = &shellcmdflag

if !go#util#IsWin() && executable('/bin/sh')
set shell=/bin/sh shellredir=>%s\ 2>&1
set shell=/bin/sh shellredir=>%s\ 2>&1 shellcmdflag=-c
endif

try
Expand All @@ -151,6 +152,7 @@ function! s:system(cmd, ...) abort
" Restore original values
let &shell = l:shell
let &shellredir = l:shellredir
let &shellcmdflag = l:shellcmdflag
endtry
endfunction

Expand Down