Skip to content

Commit 8c332d9

Browse files
committed
VimuxRunCommandInDir: run in subshell
Fixes a problem where the directory is not restored if the command exits with a non-zero code.
1 parent 21d7a34 commit 8c332d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin/vimux.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function! VimuxRunCommandInDir(command, useFile)
2020
if a:useFile ==# 1
2121
let l:file = shellescape(expand('%:t'), 1)
2222
endif
23-
call VimuxRunCommand("cd ".shellescape(expand('%:p:h'), 1)." && ".a:command." ".l:file." && cd - > /dev/null")
23+
call VimuxRunCommand("(cd ".shellescape(expand('%:p:h'), 1)." && ".a:command." ".l:file.")")
2424
endfunction
2525

2626
function! VimuxRunLastCommand()

0 commit comments

Comments
 (0)