Skip to content

Report window title (CSI 21 t)

Category: device · Baseline: rich · Tags: Xterm Extensions · Specification ↗

ESC [ 21 t
XTWINOPS subcode 21 queries the current window title. The query is CSI 21 t; the response is OSC l title ST. Applications use this to save the current title before overwriting it (so they can restore it on exit) — historically the only reliable way before XTPUSH/POP TITLE (CSI 22/23 t) was added. Many modern terminals refuse to report window titles by default for security reasons. A hostile escape sequence injected into the terminal could otherwise read a title set by a different application and exfiltrate it. xterm controls this via the allowWindowOps resource. Applications that need title save/restore should prefer the title stack (CSI 22/23 t) which works without exposing the title to other processes.
How this is testedpartial
Send \x1b[21t, verify the terminal sends an OSC l response. Many real terminals refuse to report titles for security; headless emulators that don't store titles return partial.

The same probe runs against headless backends (via Termless) and real terminal apps (via a daemon launched in each terminal). This lets us distinguish parser correctness from rendering correctness.

Analysis2026-04-06

Supported by 3 of 9 terminals (33%). Part of the Rich TUI baseline.

Supported by 1 of 14 backends (7%)

Terminal Applications

TerminalVersionSupportNotes
iTerm23.6.9✓ yestitle: bun
Ghostty1.3.1✗ noNo XTWINOPS 21 response (terminal may refuse for security)
Terminal.app2.15✗ noNo XTWINOPS 21 response (terminal may refuse for security)
Kitty0.46.2✗ noWindow operations not exposed via Python batch bridge
VS Code1.113.0? unknown
Warp0.2026.03.18.08.24.03? unknown
Cursor2.6.21? unknown

Headless Backends

Parser correctness only — a means the parser accepts the sequence.

BackendVersionSupportNotes
WezTerm0.1.0-fork.5~ partialWindow title report requires a real window system
xterm.js5.5.0~ partialWindow title report not exposed in xterm.js headless mode
Alacritty0.26.0✗ noWindow title report not implemented by alacritty
vt100.js0.2.1✗ noXTWINOPS not implemented — post-dates VT220 baseline
vterm0.2.0✗ noXTWINOPS window title report not implemented in vterm.js