Skip to content

Commit 881a9cc

Browse files
arp242fatih
authored andcommitted
Reset shell before running a command in go#util#System (#967)
* Reset shell before running a command in go#util#System This makes sure the commands still work when using a non-Bourne shell such as fish or tcsh. :help vim-doc recommends: set shell='/bin/sh' But this is not a great solution. This will mean that `:sh` will now invoke `/bin/sh`, instead of `tcsh` or `fish`. It also means that things such as shell aliases for `:!` will no longer work.
1 parent 9ed023b commit 881a9cc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

autoload/go/util.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ else
9292
endif
9393

9494
function! go#util#System(str, ...)
95-
return call(s:vim_system, [a:str] + a:000)
95+
let l:shell = &shell
96+
let &shell = '/bin/sh'
97+
let l:output = call(s:vim_system, [a:str] + a:000)
98+
let &shell = l:shell
99+
return l:output
96100
endfunction
97101

98102
function! go#util#ShellError()

0 commit comments

Comments
 (0)