From dac3388a4c344bddc080c0886a2ee13994307555 Mon Sep 17 00:00:00 2001 From: Michael van der Kamp Date: Sun, 19 Nov 2023 15:28:38 -0800 Subject: [PATCH] Throw error if system call fails --- plugin/vimux.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/vimux.vim b/plugin/vimux.vim index 51fcbf5..3f72ac1 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -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