OSC 666 Set Terminal Property
Set, reset or signal VTE's typed terminal properties, which the program embedding VTE can watch.
OSC 666 ; Pt ST
- ECMA-48
- §8.3.89 OSC – Operating System Command, p. 51
- Specification
- Terminal properties, VTE source
OSC 666 is VTE’s, the library inside GNOME Terminal and others, from 0.78. It sets termprops: named, typed variables, a boolean, an integer, a color, a string, a URI and so on, which the application embedding VTE watches through a signal. Pt is one or more statements separated by ;:
| Statement | Effect |
|---|---|
name=value | set it |
name | reset it; a name ending in . resets every one with that prefix |
name! | signal a termprop that has no value |
name? | query it |
Only registered names do anything, and a value of the wrong type resets the termprop. A program’s own termprops are named vte.ext. and the terminal’s name; VTE’s own include vte.cwd, the shell’s vte.shell.precmd, preexec and postexec, and vte.progress.hint and vte.progress.value. For now the answer to a query is always an empty OSC 666 ST, whatever was asked, for security. VTE accepts the sequence only when it ends with ST, not BEL, and RIS, DECSTR and DECSR reset every termprop. VTE documents it in its source rather than its published reference (vtegtk.cc, vteseq.cc).
A default xterm has no OSC 666 and ignores it (the OSC numbers it knows). The cases follow xterm.
libghostty-vt does not recognize OSC 666 either: its OSC parser in osc.zig has no state for the number, so the string is dropped, and the cases pass.
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 | 83edd49 | No | ignored |
| Konsole | 26.11.70, a24c3d71 | No | not among the OSC numbers it handles (Vt102Emulation.h) |
| ConEmu | build 230724, its documentation | No | not in its ANSI escape codes |
| VTE | 0.84.1, source | Yes | since 0.78; ST only, and a query is answered with an empty OSC 666 ST (vtegtk.cc) |
Validation
OSC666-1: Setting one changes nothing on screen
A
\e]666;vte.progress.value=50\e\\
B
|AB____|
cursor 1,3
reply none
OSC666-2: A query is not answered
\e]666;vte.progress.value?\e\\
|______|
reply none