Skip to content

Commit

Permalink
Throw error if system call fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanderkamp committed Nov 19, 2023
1 parent 5a7f37b commit dac3388
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugin/vimux.vim
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ function! VimuxTmux(arguments) abort
echom l:tmuxCommand
endif
if has_key(environ(), 'TMUX')
return system(l:tmuxCommand)
let l:output = system(l:tmuxCommand)
if v:shell_error
throw 'Tmux command failed with message:' . l:output
endif
return l:output
else
throw 'Aborting, because not inside tmux session.'
endif
Expand Down

0 comments on commit dac3388

Please sign in to comment.