^[control-codes live in libghostty-vt

Operating system commands

OSC l Set Window Title (dtterm)

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.

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.