Skip to main content

OSC 9

AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Experimental

OSC 9 sends a desktop notification from the terminal to the operating system's notification system. Originally introduced by ConEmu, this sequence allows command-line applications to alert the user when a long-running task completes or when attention is needed.

Syntax​

OSC 9 ; text ST
OSC 9 ; text BEL
Formal syntax
OSC9 = 0x1b, "]", "9", ";", text, ( 0x07 | 0x1b, "\\" ) ;
text = character, { character } ;

Parameters​

ParameterDescriptionDefault
textThe notification message text to display(required)

Description​

Per the ConEmu ANSI codes documentation, OSC 9 triggers a system desktop notification containing the provided text. The notification typically appears as an OS-native notification balloon, toast, or banner depending on the platform.

This is a simple fire-and-forget mechanism with no acknowledgment or response from the terminal. The notification is displayed immediately and follows the OS notification behavior (auto-dismiss, notification center, etc.).

ConEmu extended OSC 9 with additional sub-commands using a semicolon-delimited format:

  • OSC 9 ; 4 ; st ; pr ST — Progress reporting (see OSC 9;4)
  • OSC 9 ; 9 ; path ST — Set working directory (ConEmu-specific)

Some terminals (notably iTerm2 and Kitty) support OSC 9 for basic desktop notifications but may use different mechanisms for their native notification protocols.

note

Desktop notification support varies significantly across terminals. Some terminals require user opt-in for security reasons, as malicious terminal output could otherwise spam notifications.

Examples​

# Send a simple notification
printf '\e]9;Build complete!\a'

# Notify after a long-running command
make build && printf '\e]9;Build succeeded\a' || printf '\e]9;Build failed!\a'

# Notification with ST terminator
printf '\e]9;Task finished\e\\'

Specifications​

SpecificationSection
ConEmu ANSI Codes—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✗NoNot listed in escape_support.md OSC section
Bobcat✓0.9.0WhenMessage callback for desktop notifications added in commit 4a78353
contour✓v0.6.2.8008ConEmu-style notification and progress (OSC 9;4 included)
foot✓YesiTerm2/urxvt notify extension, osc.c:1381-1396, 538-590
Ghostty✓v1.0.0
iTerm2✓v20260216-nightlyConEmu/iTerm2 desktop notification
Kitty~YesSupports legacy iTerm2 OSC 9 notifications
Konsole✗NoConEmu OSC 9 recognized but only OSC 9;4 (progress) is implemented in src/Vt102Emulation.cpp:1821-1855; simple notification form not implemented
mintty✗NoNot implemented (ConEmu/iTerm2 desktop notification)
mlterm✗No
PuTTY✗NoNot implemented in do_osc function
Rio✗No
rxvt-unicode✗No
st✗No
terminology✗NoOSC 777 used instead for notifications
VT100✗No
VTE✗NoOSC 9 basic notification not implemented, only 9;4 for progress
WezTerm✓YesOSC 9 SystemNotification (ConEmu/iTerm2) - see wezterm-escape-parser/src/osc.rs:43,318-350,470
Windows Terminal✓YesConEmuAction case; handles OSC 9;4 (progress), 9;9 (CWD), 9;12 (mark)
xterm✗NoNo evidence in documentation or source code
xterm.js✗NoNot implemented
Multiplexers
cy✗No
GNU Screen✗No
tmux✗NoConEmu notifications not implemented
tuios✗No
Zellij✗No

See also​