Summary
OSC 0 and OSC 2 escape sequences (used by applications to set the terminal/pane title) do not propagate to pane_title (#{pane_title} / #T format variable).
In tmux, when a child process sends an OSC 0 or OSC 2 sequence, the pane title is updated immediately (gated by the allow-set-title option). In psmux, the vt100 parser correctly stores the title from OSC sequences, but the propagation from the parser to pane.title only happens inside the DumpState handler, which only runs when a TUI client is attached. For detached sessions or CLI queries, the pane title never reflects OSC updates.
Environment
Windows (ConPTY / PowerShell 7 as default shell)
Steps to reproduce
psmux new-session -d -s osc_test
psmux send-keys -t osc_test "Write-Host -NoNewline ([char]27 + ']2;MY_CUSTOM_TITLE' + [char]7)" Enter
Start-Sleep 3
psmux display-message -t osc_test -p '#{pane_title}'
Observed behavior
pane_title stays as the hostname (e.g. SUPERTOP) and never updates to MY_CUSTOM_TITLE.
Expected behavior
pane_title should reflect the latest OSC 0/2 title set by the child process (matching tmux behavior), as long as allow-set-title is on.
Root cause
The OSC title propagation code in server/mod.rs was:
- Only called inside the
DumpState handler (never runs for detached sessions)
- Nested inside the
(auto_rename || allow_rename) guard, making it dependent on window rename settings
- Not called before state query commands like
display-message, list-panes, list-windows
tmux reference
In tmux input.c, input_exit_osc() for OSC 0 and 2:
if (wp != NULL &&
options_get_number(wp->options, "allow-set-title") &&
screen_set_title(sctx->s, p)) {
notify_pane("pane-title-changed", wp);
}
The title is stored directly in wp->base.title and immediately available via #{pane_title}.
Summary
OSC 0 and OSC 2 escape sequences (used by applications to set the terminal/pane title) do not propagate to
pane_title(#{pane_title}/#Tformat variable).In tmux, when a child process sends an OSC 0 or OSC 2 sequence, the pane title is updated immediately (gated by the
allow-set-titleoption). In psmux, the vt100 parser correctly stores the title from OSC sequences, but the propagation from the parser topane.titleonly happens inside theDumpStatehandler, which only runs when a TUI client is attached. For detached sessions or CLI queries, the pane title never reflects OSC updates.Environment
Windows (ConPTY / PowerShell 7 as default shell)
Steps to reproduce
Observed behavior
pane_titlestays as the hostname (e.g.SUPERTOP) and never updates toMY_CUSTOM_TITLE.Expected behavior
pane_titleshould reflect the latest OSC 0/2 title set by the child process (matching tmux behavior), as long asallow-set-titleison.Root cause
The OSC title propagation code in
server/mod.rswas:DumpStatehandler (never runs for detached sessions)(auto_rename || allow_rename)guard, making it dependent on window rename settingsdisplay-message,list-panes,list-windowstmux reference
In tmux
input.c,input_exit_osc()for OSC 0 and 2:The title is stored directly in
wp->base.titleand immediately available via#{pane_title}.