Set --border-label as the title of the tmux floating pane (#4853)

The pane sets the options itself before running fzf, so that they are
in place no matter how quickly the command exits, targeted at
$TMUX_PANE; the default target would resolve to the active pane of
the session's current window.

- pane-border-format is set to '#{pane_title}' so that the label is
  displayed on the border when pane-border-status is enabled;
  pane-border-status itself is a window option in released tmux
  versions and is left alone
- When a border style is explicitly specified with --border, a popup
  is used instead of a floating pane so that the fzf-drawn border is
  the only border shown; give 'border-native' to force a floating pane
- 'none' and 'line' are treated as no border; fzf draws no box for
  either, so the label is displayed on the native border
- Remove 'border-fzf' which is now redundant; it was never released
- The title is escaped for select-pane -T which expands format
  expressions; a lone ';' is escaped as tmux would treat it as a
  command separator
- The label is skipped when ANSI stripping leaves an empty string
- --border-label-pos is ignored
- Fix remain-on-exit set on the original pane instead of the floating
  pane
This commit is contained in:
Junegunn Choi
2026-07-05 19:35:34 +09:00
committed by GitHub
parent 1e31e5dfbe
commit 77e6394f50
8 changed files with 146 additions and 40 deletions
+10 -4
View File
@@ -417,7 +417,7 @@ layout options so that the specified number of items are visible in the list
section (default: \fB10+\fR).
Ignored when \fB\-\-height\fR is not specified or set as an absolute value.
.TP
.BI "\-\-popup" "[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]][,border-native|border-fzf]]"
.BI "\-\-popup" "[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]][,border-native]]"
Start fzf in a tmux or Zellij floating pane (default \fBcenter,50%\fR).
Requires tmux 3.3+ or Zellij 0.44+. This option is ignored if you
are not running fzf inside tmux or Zellij. \fB\-\-tmux\fR is an alias for this option.
@@ -426,9 +426,15 @@ On tmux 3.7 or above, the floating pane is not modal; you can switch to
other panes and windows while fzf is running, move and resize the pane with
the mouse, zoom it to fullscreen, and use copy\-mode in it. The pane always
has a native border, which is what makes it movable and resizable, so
\fBborder\-native\fR is implied. On tmux versions below 3.7, or when
\fBborder\-fzf\fR is given, a modal tmux popup is used instead and fzf draws
its own border.
\fBborder\-native\fR is implied. \fB\-\-border\-label\fR is set as the title
of the pane, and is displayed on the border if \fBpane\-border\-status\fR
is enabled in tmux (\fB\-\-border\-label\-pos\fR is ignored).
A modal tmux popup is used instead on tmux versions below 3.7, or when a
border style is explicitly specified with \fB\-\-border\fR, so that the
fzf\-drawn border is the only border shown. \fBnone\fR and \fBline\fR are
treated as no border. Give \fBborder\-native\fR to
force a floating pane nonetheless.
e.g.
\fB# Popup in the center with 70% width and height