Skip to content
Myr

Comment why floating pane requires TMUX_PANE

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Blocking run-shell suspends client key processing until the command exits, so a floating pane deadlocks; popup input bypasses the suspended path. Fall back to display-popup when TMUX_PANE is not set.

authored by Junegunn Choi · committed by Junegunn Choi · parent 24832e9 · Browse files · 1 file+10 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−0 removed

  • other:+10 added−0 removed

1 file+10 added−0 removed

modified:src/tmux.go+10 added
11 unmodified lines
1213// Returns the size of the current window if the tmux server supports14// floating panes (tmux 3.7 or above)15func tmuxFloatingPaneInfo() (int, int, bool) {16 // TMUX_PANE is not set when fzf is not started from within a pane17 // (e.g. 'bind-key 0 run-shell "fzf --popup"'). Do not use a floating18 // pane there; a blocking run-shell suspends key processing for the19 // client until the command exits, so fzf in a floating pane would20 // never receive a key and the client would appear frozen until the21 // process is killed externally. A popup is unaffected; its input is22 // handled at the client overlay level, bypassing the suspended path.23 // The right approach for such bindings is 'run-shell -b', which does24 // not suspend key processing, as discussed in:25 // https://github.com/tmux/tmux/issues/538426 target := os.Getenv("TMUX_PANE")27 if target == "" {28 return 0, 0, false29 }
228 unmodified lines