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.
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