OSC 777 Perl Extension Command
Pass a string to one of rxvt-unicode's Perl extensions; with the prefix notify, show a desktop notification.
OSC 777 ; prefix ; Pt ST
- ECMA-48
- §8.3.89 OSC – Operating System Command, p. 51
- Specification
- urxvtperl, rxvt-unicode's Perl extension manual
rxvt-unicode can be extended with Perl, and OSC 777 is how a program talks to an extension: OSC 777 ; prefix ; Pt ST hands Pt to the extension that registered prefix, and to nothing else. Its definition is the on_osc_seq_perl hook in rxvt-unicode’s urxvtperl manual, which asks that the prefix be the extension’s name, so that extensions do not take each other’s commands. What a command does is up to its extension; a terminal without that extension does nothing with it.
One prefix has spread beyond rxvt-unicode. Several terminals, Ghostty among them, take OSC 777 ; notify ; title ; body ST as a request to show a desktop notification, with a title as well as the body that iTerm2’s OSC 9 has.
A default xterm has no OSC 777 and ignores it (the OSC numbers it knows). The cases follow xterm.
libghostty-vt recognizes only the notify prefix, and passes the title and body to its host through the DESKTOP_NOTIFICATION callback, which the runner does not install; any other prefix is ignored. What a case can see is that nothing is printed, answered or rung, and libghostty-vt passes.
Support
| Terminal | Version | Support | Notes |
|---|---|---|---|
| VT220 | manual, 2nd ed., 1984 | No | OSC is not among the controls it recognizes (§4.2) |
| VT510 | manual, 1st ed., 1993 | No | ignores an OSC string (chapter 4) |
| xterm | patch 412, xterm-411a | No | ignored |
| libghostty-vt | 0f171f6 | Partly | only the notify prefix, passed to the host’s DESKTOP_NOTIFICATION callback |
| Konsole | 26.11.70, a24c3d71 | Partly | only notify and its own container prefix |
| ConEmu | build 230724, its documentation | No | not in its ANSI escape codes |
| rxvt-unicode | 9.31, urxvtperl(3) | Yes | hands it to the Perl extension that registered the prefix: urxvtperl |
Validation
OSC777-1: A notification changes nothing on screen
A
\e]777;notify;make;Build finished\a
B
|AB____|
cursor 1,3
reply none
bell 0
OSC777-2: Nor does a command for another extension
A
\e]777;myext;hello\a # for an extension called myext
B
|AB____|
cursor 1,3
reply none