Abort with an error if run outside tmux session (#204)

Otherwise, the command sent will run in a different and likely unexpected tmux session.
fix-tmux-next-3dot4
Samuel Walladge 3 years ago committed by GitHub
parent a1650d5f9b
commit 853646aef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -193,7 +193,11 @@ function! VimuxTmux(arguments) abort
if VimuxOption('VimuxDebug')
echom VimuxOption('VimuxTmuxCommand').' '.a:arguments
endif
return system(VimuxOption('VimuxTmuxCommand').' '.a:arguments)
if has_key(environ(), 'TMUX')
return system(VimuxOption('VimuxTmuxCommand').' '.a:arguments)
else
throw 'Aborting, because not inside tmux session.'
endif
endfunction
function! s:tmuxSession() abort

Loading…
Cancel
Save