Skip to content

Operating System Commands (OSC)

Operating System Command (OSC) sequences use the ESC ] format for out-of-band communication between applications and the terminal emulator. Unlike CSI sequences which control the terminal's display, OSC sequences communicate with the "operating system" (the terminal application itself). Key sequences: window title (OSC 0/2), clipboard access (OSC 52), hyperlinks (OSC 8), color palette queries (OSC 4/10/11), semantic prompt markers (OSC 133), and notification (OSC 9/777). The OSC namespace is open-ended — any terminal can define new numbers without conflicting with CSI-based control codes. This open-endedness is both a strength and a weakness: it allows rapid innovation (iTerm2 alone defines dozens of proprietary OSC sequences), but there is no registry or coordination — terminals occasionally pick the same number for different purposes.

61 features in this standard · Specification ↗

The OSC protocol structure is ESC ] Ps ; Pt ST — a numeric identifier, a semicolon, the payload, and a string terminator (ESC \ or BEL). This format is both its simplicity and its limitation: the number namespace is flat (no hierarchy), and there is no formal registry. OSC 52 (ESC ]52;c;base64-data ST) provides clipboard access — an application can read and write the system clipboard through the terminal, which is essential for remote vim/tmux sessions over SSH where the system clipboard isn't directly accessible.

OSC 8 (ESC ]8;params;url ST) brings clickable hyperlinks to the terminal. Text between an OSC 8 open and close sequence becomes a link — ls can link filenames to file:// URLs, compiler errors can link to source locations, and git log can link commit hashes to GitHub. Adopted by Ghostty, iTerm2, WezTerm, foot, and most modern terminals. Notably absent from Terminal.app.

OSC 133 defines semantic prompt markers — shell integration that tells the terminal where prompts, commands, and output begin and end. This powers VS Code's command decorations, iTerm2's command history navigation, and Ghostty's prompt-to-prompt scrolling. Each shell (bash, zsh, fish) emits slightly different markers, making robust integration a cross-platform challenge.

Sources

Unlike CSI sequences which are defined by ECMA-48, OSC numbers have no central registry. The features tracked here come from multiple independent sources:

  • Xterm Extensions — The de facto reference. Defines OSC 0–7 (title, icon, CWD), OSC 10–19 (dynamic colors), OSC 22 (pointer shape), OSC 50–52 (font, clipboard), and their resets (OSC 104–119). Most widely adopted OSCs originate here.
  • ConEmu Extensions — OSC 9 subtypes including 9;4 (progress bar), 9;9 (CWD). The progress bar protocol has been widely adopted by Ghostty, iTerm2, Windows Terminal, WezTerm, and others.
  • iTerm2 ExtensionsOSC 1337 namespace with subcommands for inline images, cell size reporting, capability queries, annotations, and more. Some features (images, cell size) adopted by other terminals.
  • Kitty Extensions — OSC 66 (text sizing), OSC 5522 (advanced clipboard with MIME types). Newer protocols designed to address limitations of OSC 52.
  • VS Code ExtensionsOSC 633 for VS Code-specific shell integration, extending OSC 133 with additional markers for command line capture and properties.
  • FinalTerm semantic promptsOSC 133, the original shell integration protocol. Prompt/command/output markers now adopted by iTerm2, VS Code, Ghostty, and others.
Analysis2026-04-06

Operating System Commands (OSC) defines 61 features in the terminfo.dev matrix. Average adoption across terminals: 74%. Lowest: vt100.js at 37% (14/38).

Terminal Applications

FeatureiTerm2GhosttyVS CodeWarpCursorTerminal.app
Icon and title (OSC 0)
Icon name (OSC 1)
Window title (OSC 2)
Color palette (OSC 4)
Special color (OSC 5)
Current directory (OSC 7)
Hyperlinks (OSC 8)
Desktop Notifications (OSC 9/777)
OSC 9;4 progress bar
Foreground color query (OSC 10)
Background color query (OSC 11)
Cursor color (OSC 12)
Highlight background (OSC 17)
Highlight foreground (OSC 19)
Kitty color protocol (OSC 21)
Pointer shape (OSC 22)
Clipboard access (OSC 52)
OSC 52 clipboard write
OSC 52 clipboard read
OSC 66 text sizing
Desktop notifications (OSC 99)
Reset color palette (OSC 104)
Reset foreground color (OSC 110)
Reset background color (OSC 111)
Reset cursor color (OSC 112)
Reset pointer fg color (OSC 113)
Reset pointer bg color (OSC 114)
Reset highlight background (OSC 117)
Reset highlight foreground (OSC 119)
Semantic prompts (OSC 133)
OSC 133;A prompt start (FTCS_PROMPT)
OSC 133;B command start (FTCS_COMMAND_START)
OSC 133;C command executed (FTCS_COMMAND_EXECUTED)
OSC 133;D command finished (FTCS_COMMAND_FINISHED)
OSC 133;P properties
Set Wayland app-id (OSC 176)
Audio sound (OSC 440)
Screen flash (OSC 555)
VS Code Shell Integration (OSC 633)
OSC 633;A prompt start
OSC 633;B prompt end
OSC 633;C pre-execution
OSC 633;D command finished
OSC 633;E set commandline
OSC 633;P properties
VTE termprop (OSC 666)
Locale query/set (OSC 701)
Version query (OSC 702)
Set normal font (OSC 710)
Scroll view up (OSC 720)
Cell size report (OSC 776)
Notifications (OSC 777)
iTerm2 Inline Images (OSC 1337)
iTerm2 Cell Size Reporting (OSC 1337)
iTerm2 Capability Reporting (OSC 1337)
Systemd context (OSC 3008)
OSC 5522 advanced clipboard
Font size query/set (OSC 7770)
Font + window size (OSC 7777)
Kitty color stack push (OSC 30001)
Kitty color stack pop (OSC 30101)

Headless Backends

Parser correctness tested via Termless. A means the parser accepts the sequence, not that it renders correctly.

Featurevtermxterm.jsKittyAlacrittyWezTermvt100.js
Icon and title (OSC 0)
Icon name (OSC 1)
Window title (OSC 2)
Color palette (OSC 4)
Special color (OSC 5)
Current directory (OSC 7)~~~
Hyperlinks (OSC 8)
Desktop Notifications (OSC 9/777)~~~
OSC 9;4 progress bar??????
Foreground color query (OSC 10)~~~
Background color query (OSC 11)~~~
Cursor color (OSC 12)
Highlight background (OSC 17)
Highlight foreground (OSC 19)
Kitty color protocol (OSC 21)~
Pointer shape (OSC 22)??????
Clipboard access (OSC 52)~~~
OSC 52 clipboard write
OSC 52 clipboard read~~~
OSC 66 text sizing~
Desktop notifications (OSC 99)??????
Reset color palette (OSC 104)
Reset foreground color (OSC 110)
Reset background color (OSC 111)
Reset cursor color (OSC 112)
Reset pointer fg color (OSC 113)??????
Reset pointer bg color (OSC 114)??????
Reset highlight background (OSC 117)
Reset highlight foreground (OSC 119)
Semantic prompts (OSC 133)~
OSC 133;A prompt start (FTCS_PROMPT)
OSC 133;B command start (FTCS_COMMAND_START)
OSC 133;C command executed (FTCS_COMMAND_EXECUTED)
OSC 133;D command finished (FTCS_COMMAND_FINISHED)
OSC 133;P properties
Set Wayland app-id (OSC 176)??????
Audio sound (OSC 440)??????
Screen flash (OSC 555)??????
VS Code Shell Integration (OSC 633)~
OSC 633;A prompt start
OSC 633;B prompt end
OSC 633;C pre-execution
OSC 633;D command finished
OSC 633;E set commandline
OSC 633;P properties
VTE termprop (OSC 666)??????
Locale query/set (OSC 701)??????
Version query (OSC 702)??????
Set normal font (OSC 710)??????
Scroll view up (OSC 720)??????
Cell size report (OSC 776)??????
Notifications (OSC 777)??????
iTerm2 Inline Images (OSC 1337)
iTerm2 Cell Size Reporting (OSC 1337)
iTerm2 Capability Reporting (OSC 1337)
Systemd context (OSC 3008)??????
OSC 5522 advanced clipboard~
Font size query/set (OSC 7770)??????
Font + window size (OSC 7777)??????
Kitty color stack push (OSC 30001)??????
Kitty color stack pop (OSC 30101)??????