Separate floating pane border label from pane title

--border-label of a tmux floating pane was stored in the pane title and
read back by pane-border-format as '#{pane_title}', so any program in the
pane could replace the border text by setting the title. On Zellij the
name was only set when the pane was created. Either way the built-in
label actions could not touch it, as fzf draws no border of its own
there.

- tmux: hold the label in pane-scoped @fzf-border-label. Set the option
  even without a label, so a later change-border-label has somewhere to
  write. Drop select-pane -T; the pane title is left to the user
- Zellij: run 'zellij action rename-pane' on label change. 'zellij run'
  has no option to set the environment of the new pane, so the command
  exports the target itself
- change-border-label and transform-border-label now update the native
  border, through the setter nativeLabelSetter picks by multiplexer
- The pane is named in a __FZF_INTERNAL_ variable that runProxy withholds
  from the environment replay, so the same name in the outer environment
  cannot redirect the update to another pane
This commit is contained in:
Junegunn Choi committed 2026-07-29 20:59:52 +09:00
1 parent b5f2ba4fd4
commit 50e6c026ec
9 files changed
+279 -57

No files matched your search

+6
View File
@@ -470,6 +470,7 @@ type Terminal struct {
clickFooterLine int
clickFooterColumn int
proxyScript string
setNativeLabel func(string)
numLinesCache map[int32]numLinesCacheValue
raw bool
lastActivity time.Time
@@ -1142,6 +1143,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
printer: opts.Printer,
printsep: opts.PrintSep,
proxyScript: opts.ProxyScript,
setNativeLabel: nativeLabelSetter(),
merger: em,
passMerger: em,
resultMerger: em,
@@ -7272,6 +7274,10 @@ func (t *Terminal) Loop() error {
if t.border != nil {
t.borderLabel, t.borderLabelLen = t.ansiLabelPrinter(label, &tui.ColBorderLabel, false)
req(reqRedrawBorderLabel)
} else if t.setNativeLabel != nil {
// fzf draws no border of its own; the label is on the
// native border of the floating pane
t.setNativeLabel(label)
}
})
case actChangePreviewLabel, actTransformPreviewLabel, actBgTransformPreviewLabel: