From 54bc909d323bc11905a6db9eeb461111b5b4d70c Mon Sep 17 00:00:00 2001 From: Andrey Kaipov Date: Thu, 7 Mar 2024 13:46:13 -0500 Subject: [PATCH] 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. --- autoload/tpipeline.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/tpipeline.vim b/autoload/tpipeline.vim index 1d7e265..fe5008c 100644 --- a/autoload/tpipeline.vim +++ b/autoload/tpipeline.vim @@ -192,7 +192,7 @@ func tpipeline#fork_job() endif endif if g:tpipeline_usepane - let script .= "; tmux select-pane -T \"#[fill=${C:3}]#[align=left]$l#[align=right]$r\"" + let script .= "; tmux select-pane -t \"$TMUX_PANE\" -T \"#[fill=${C:3}]#[align=left]$l#[align=right]$r\"" endif let script .= "; " . g:tpipeline_refreshcmd . "; done"