Skip to content

Commit

Permalink
Reset shell before running a command in go#util#System (#967)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
arp242 authored and fatih committed Jul 31, 2016
1 parent 9ed023b commit 881a9cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoload/go/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ else
endif

function! go#util#System(str, ...)
return call(s:vim_system, [a:str] + a:000)
let l:shell = &shell
let &shell = '/bin/sh'
let l:output = call(s:vim_system, [a:str] + a:000)
let &shell = l:shell
return l:output
endfunction

function! go#util#ShellError()
Expand Down

0 comments on commit 881a9cc

Please sign in to comment.