From 45734f60de4b67bfc4ab3333b876059cb2047eed Mon Sep 17 00:00:00 2001 From: Bryan Richter Date: Fri, 12 Aug 2016 13:35:22 +0300 Subject: [PATCH 1/2] Protect strings that start with a dash Otherwise they're interpreted as options to tmux. --- autoload/tmuxify.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/tmuxify.vim b/autoload/tmuxify.vim index 911c007..4da4900 100644 --- a/autoload/tmuxify.vim +++ b/autoload/tmuxify.vim @@ -9,7 +9,7 @@ endif let g:autoloaded_tmuxify = 1 " s:SID() {{{1 -function s:SID() abort +function! s:SID() abort return matchstr(expand(''), '\zs\d\+\ze_SID$') endfun @@ -198,13 +198,13 @@ function! tmuxify#pane_send(bang, ...) abort if exists('a:1') for line in split(a:1, '\n') - call system('tmux send-keys -t '. pane_descriptor .' -l '. shellescape(s:fixstr(line)) .' && tmux send-keys -t '. pane_descriptor .' C-m') + call system('tmux send-keys -t '. pane_descriptor .' -l -- '. shellescape(s:fixstr(line)) .' && tmux send-keys -t '. pane_descriptor .' C-m') if v:shell_error echoerr 'tmuxify: A certain version of tmux 1.6 or higher is needed. Consider updating to 1.7+.' endif endfor else - call system('tmux send-keys -t '. pane_descriptor .' '. shellescape(s:fixstr(input('TxSend> '))) .' C-m') + call system('tmux send-keys -t '. pane_descriptor .' -- '. shellescape(s:fixstr(input('TxSend> '))) .' C-m') endif endfunction @@ -238,7 +238,7 @@ function! tmuxify#pane_send_raw(cmd, bang) abort let keys = a:cmd endif - call system('tmux send-keys -t '. pane_descriptor ." '". keys . "'") + call system('tmux send-keys -t '. pane_descriptor ." -- '". keys . "'") endfunction " tmuxify#set_run_command_for_filetype() {{{1 From 3e84e182f388d576428f948fc56c8a330301b23c Mon Sep 17 00:00:00 2001 From: Bryan Richter Date: Fri, 12 Aug 2016 14:10:34 +0300 Subject: [PATCH 2/2] Fix ';' for SendKey too --- autoload/tmuxify.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/tmuxify.vim b/autoload/tmuxify.vim index 4da4900..0c82f37 100644 --- a/autoload/tmuxify.vim +++ b/autoload/tmuxify.vim @@ -238,7 +238,7 @@ function! tmuxify#pane_send_raw(cmd, bang) abort let keys = a:cmd endif - call system('tmux send-keys -t '. pane_descriptor ." -- '". keys . "'") + call system('tmux send-keys -t '. pane_descriptor ." -- '". s:fixstr(keys) . "'") endfunction " tmuxify#set_run_command_for_filetype() {{{1