^[control-codes live in libghostty-vt

Operating system commands

OSC 30 Tab Title (Konsole)

Set the title of Konsole's tab.

OSC 30 ; Pt ST
ECMA-48
§8.3.89 OSC – Operating System Command, p. 51
Specification
Session::SessionAttributes, Konsole's source

OSC 30 ; Pt ST sets the title of the session’s tab in Konsole to Pt, which it calls the session name; OSC 2 sets the window’s. The text replaces the tab’s title format, the one Konsole’s settings let a user write, so its placeholders work in it too: %d for the current directory, %n for the program running, %u for the user, and others (Session.cpp). A shell can put OSC 30 ; %d ST in its prompt and leave Konsole to fill in the directory.

Konsole, KDE’s terminal, has a few OSC numbers of its own. It documents none of them, so the definition is its source: the numbers are listed in Session::SessionAttributes, and acted on in Session::setSessionAttribute. They are OSC 30, OSC 32 and OSC 34, with a profile change under OSC 50, and once OSC 31.

xterm sets the number aside for Konsole and does nothing with it: its list of OSC numbers names 30 and 31 Konsole (unused) (misc.c). libghostty-vt has no Konsole code, and ignores it too.

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-411aNothe number is set aside for Konsole, unused
libghostty-vt83edd49Noignored
Konsole26.11.70, a24c3d71Yesthe tab title format, with placeholders such as %d
ConEmubuild 230724, its documentationNonot in its ANSI escape codes

Validation

OSC30-1: Not the window title

\e]30;tab\a
|___|
title ""

OSC30-2: Nothing on screen

A
\e]30;%d\a
B
|AB_|
cursor 1,3
reply none
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.