OSC 777
OSC 777 sends a desktop notification using the format originally introduced by rxvt-unicode (urxvt). The sequence includes a command name, notification title, and notification body.
Syntax
OSC 777 ; notify ; title ; body ST
OSC777 = 0x1b, "]", "777", ";", "notify", ";", title, ";", body, ( 0x07 | 0x1b, "\\" ) ;
title = { printable-char } ;
body = { printable-char } ;Parameters
| Parameter | Description |
|---|---|
notify | The command name (literal string notify). |
title | The notification title text. |
body | The notification body text. |
Description
OSC 777 originated in rxvt-unicode (urxvt) as a general-purpose extension mechanism. The notify subcommand triggers a desktop notification with the specified title and body text. The notification is typically displayed using the system's native notification framework (e.g., D-Bus notifications on Linux, Notification Center on macOS).
The general form of OSC 777 is OSC 777 ; command ; args... ST, where the command name determines the behavior. The notify command is by far the most widely adopted. Other urxvt-specific commands exist but are not commonly supported by other terminals.
Compared to other notification protocols
| Protocol | Format | Features |
|---|---|---|
| OSC 9 | OSC 9 ; text ST | Title only, no body |
| OSC 777 | OSC 777 ; notify ; title ; body ST | Title and body |
| OSC 99 (Kitty) | OSC 99 ; key=value ST | Rich: identifiers, callbacks, urgency, multi-part |
OSC 777 offers a middle ground between the minimal OSC 9 (which has no body field) and the feature-rich Kitty OSC 99 protocol. For applications that need a simple title-and-body notification with reasonable terminal compatibility, OSC 777 is a practical choice.
Some terminals only display the notification when the terminal window is not focused, to avoid interrupting the user unnecessarily. Behavior may vary.
Examples
# Send a notification with title and body
printf '\e]777;notify;Build Complete;Your project has finished compiling.\e\\'
# Notify when a long-running command finishes
sleep 60 && printf '\e]777;notify;Timer;60 seconds have elapsed.\e\\'
# Using BEL as the string terminator
printf '\e]777;notify;Alert;Something happened.\a'
Specifications
| Specification | Section |
|---|---|
| XTerm ctlseqs | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✗ | No | |
| Bobcat | ? | ? | Would be handled by underlying TerminalCtrl library, not directly in Bobcat code |
| contour | ✓ | v0.1.0 | OSC 777 urxvt-style notifications (NOTIFY) implemented in Functions.h line 638 and Screen.cpp lines 4054,3056-3066, expects format 'notify;title;message' |
| foot | ✓ | 1.6.0 | urxvt-style notifications, specifically the 'notify' command |
| Ghostty | ✓ | v1.0.0 | urxvt-style notifications |
| iTerm2 | ✓ | Yes | OSC 9 notifications via ITERM_USER_NOTIFICATION token (urxvt-compatible) |
| Kitty | ✓ | 0.23.0 | |
| Konsole | ✓ | Yes | Supports urxvt-style notifications and container detection (toolbox/distrobox push/pop) |
| mintty | ✗ | No | No implementation found for OSC 777 urxvt notifications |
| mlterm | ✗ | No | |
| PuTTY | ✗ | No | |
| Rio | ✗ | No | |
| rxvt-unicode | ✓ | 6.3 | URxvt_perl - for Perl extensions with 'extension-name;' format |
| st | ✗ | No | |
| terminology | ✓ | v0.8.0 | Desktop notifications via notify; command |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | Requires enable-legacy-osc777 property; translates to termprops |
| WezTerm | ✓ | 20210314-114017-04b7cedd | urxvt-style notifications (RxvtExtension) |
| Windows Terminal | ✗ | No | |
| xterm | ✗ | No | urxvt-style notifications not implemented |
| xterm.js | ✗ | No | |
| Multiplexers | |||
| cy | ✗ | No | |
| GNU Screen | ✗ | No | |
| tmux | ✗ | No | |
| tuios | ✗ | No | |
| Zellij | ✗ | No | No OSC 777 notification support found |
See also
- OSC 9 — Desktop Notification — Simple notification (title only)
- Kitty OSC 99 — Desktop Notifications — Rich notification protocol