^[control-codes
live in libghostty-vt

Operating system commands

OSC l Set Window Title (dtterm)

View as Markdown

Set the window title, as Sun's terminals and dtterm did.

OSC l Pt ST
ECMA-48
§8.3.89 OSC – Operating System Command, p. 51
xterm
Operating System Commands

OSC l Pt ST sets the window title to Pt, as OSC 2 does.

Sun’s terminals and CDE’s dtterm set the title and the icon with a letter instead of a number, and xterm accepts their forms too: its Control Sequences document lists them in its table of the Sun and dtterm window operations. There is no ;: everything after the letter is the text, a ; included (do_osc).

It is also the form xterm answers in when it reports the title, CSI 21 t (see XTWINOPS), though a default xterm refuses that report. Unlike OSC 2, an empty OSC l ST sets an empty title: the xterm put in place of an empty one is only for the numbered forms.

libghostty-vt has only the numbered forms and ignores the letters, so the cases that set the title are known differences.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984NoOSC is not among the controls it recognizes (§4.2)
VT510manual, 1st ed., 1993Noignores an OSC string (chapter 4)
xtermpatch 412, xterm-411aYes
libghostty-vt0f171f6NoOSC-l-1, OSC-l-2: only the numbered forms
Konsole26.11.70, a24c3d71No
kitty0.49.1, run in a VMNofails the 2 cases that show it working
foot1.28.0, run in a VMNofails the 2 cases that show it working
pyte0.8.2, run as a libraryNofails the 2 cases that show it working
xterm.js headless6.0.0, run as a libraryNofails the 2 cases that show it working
alacritty_terminal0.26.0, run as a libraryNofails the 2 cases that show it working
ConEmubuild 230724, its documentationNonot in ConEmu’s list, though it reports the title in this form for CSI 21 t, ANSI escape codes
rxvt-unicode9.31, run in a VMNofails the 2 cases that show it working
VTE0.84.1, run as a libraryNofails the 2 cases that show it working

Validation

OSC-l-1: The dtterm form

\e]lHello\e\\
|___|
title "Hello"

OSC-l-2: Everything after the l is the title

\e]l;two;parts\a
|___|
title ";two;parts"
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.