From f698799ca0e6b83904485bdee8b4304f9b1b1f33 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Wed, 27 Jul 2016 15:05:14 +0200 Subject: [PATCH 1/2] 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. --- autoload/go/util.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/go/util.vim b/autoload/go/util.vim index 176e88c467..3538eab861 100644 --- a/autoload/go/util.vim +++ b/autoload/go/util.vim @@ -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() From 5c9dc0d0284ac605d522bb71b5e752e40320a79a Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Wed, 27 Jul 2016 15:07:29 +0200 Subject: [PATCH 2/2] Use same indentation style as the rest of the project --- autoload/go/util.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autoload/go/util.vim b/autoload/go/util.vim index 3538eab861..8e573f3135 100644 --- a/autoload/go/util.vim +++ b/autoload/go/util.vim @@ -92,11 +92,11 @@ else endif function! go#util#System(str, ...) - 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 + 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()