Skip to content

Commit bc6dfc1

Browse files
andreykaipovvimpostor
authored andcommitted
tpipeline_usepane: target the original tmux pane vim forked the job in
When using the tpipeline_usepane option, if someone switches tmux panes quickly after starting vim, namely before `tmux select-pane -T ...` can execute, it'll change the pane title of the current pane we're on. To prevent this from happening, we target the original pane by using $TMUX_PANE. This variable should exist in every tmux session, but if for some reason it's not present, tmux falls back to the current pane.
1 parent cbaa8b5 commit bc6dfc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/tpipeline.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func tpipeline#fork_job()
192192
endif
193193
endif
194194
if g:tpipeline_usepane
195-
let script .= "; tmux select-pane -T \"#[fill=${C:3}]#[align=left]$l#[align=right]$r\""
195+
let script .= "; tmux select-pane -t \"$TMUX_PANE\" -T \"#[fill=${C:3}]#[align=left]$l#[align=right]$r\""
196196
endif
197197
let script .= "; " . g:tpipeline_refreshcmd . "; done"
198198

0 commit comments

Comments
 (0)