^[control-codes live in libghostty-vt

Operating system commands

OSC 633 VS Code Shell Integration

VS Code's marks for prompts, commands and their output, with the command line and properties added to OSC 133's.

OSC 633 ; Ps [ ; Pt ] ST
ECMA-48
§8.3.89 OSC – Operating System Command, p. 51
Specification
Terminal shell integration, VS Code documentation

OSC 633 is the VS Code terminal’s version of OSC 133: marks a shell’s integration script sends so that the terminal knows where each prompt, command and output is. VS Code uses them to decorate commands with their status, to move between them, and to know the working directory.

PsMarks
Athe start of a prompt
Bthe end of the prompt, where the command line starts
Cjust before the command’s output
D [ ; exit-code ]the end of the command; with no exit code, no command ran, as for an empty line or Ctrl+C
E ; command-line [ ; nonce ]the exact command line
P ; Name=Valuea property: Cwd, IsWindows (True or False), or HasRichCommandDetection

E exists because reading the command off the screen is unreliable. Its command line escapes \ as \\ and writes ;, and every character at or below space, as \xAB; the optional nonce, which VS Code gives the script, shows the sequence came from it, and some protections are relaxed when it matches. VS Code’s documentation asks other terminals to ignore these, and scripts to send them only when TERM_PROGRAM is vscode (shell integration). Its source knows further sub-commands that it marks as unfinished and not to be used (shellIntegrationAddon.ts).

A default xterm has no OSC 633 and ignores it (the OSC numbers it knows). The cases follow xterm.

libghostty-vt does not recognize OSC 633 either: its OSC parser in osc.zig has no state for the number, so the string is dropped, and the cases pass.

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-411aNoignored
libghostty-vt83edd49Noignored
Konsole26.11.70, a24c3d71Nonot among the OSC numbers it handles (Vt102Emulation.h)
ConEmubuild 230724, its documentationNonot in its ANSI escape codes
VS Code1.140.0, its documentationYesits own shell integration (documentation)

Validation

OSC633-1: The marks do not show

\e]633;A\a$\s
\e]633;B\a
ls
\e]633;E;ls\a
\e]633;C\a
|$_ls__|
cursor 1,5
reply none

OSC633-2: Nor does a property, and the working directory is not set

A
\e]633;P;Cwd=/tmp\a
B
|AB____|
pwd ""
reply none
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.