wire / terminal-osc / 50
OSC 50 ; spec ST sets the terminal font at runtime. In xterm the spec is an X Logical Font Description (or '#N' to pick a numbered font from the menu); a bare '?' or empty query asks the current font back. iTerm2 also implements OSC 50 to change the session font. It is a de-facto, divergent feature across the two.
aka: set font · OSC 50 · ESC ] 50 · change font
OSC introducer: \x1b] ESC ] (0x1B 0x5D)
terminator (ST|BEL): ST \x1b\ · BEL \x07
| id | name | bytes (ST) | meaning |
|---|---|---|---|
| set | Set font | \x1b]50;#3\x1b\ | OSC 50 ; spec ST sets the font. xterm: spec is an XLFD or '#N' to select a numbered font; iTerm2: its own font-spec syntax. |
| query | Query font (xterm) | \x1b]50;?\x1b\ | OSC 50 ; ? ST asks xterm for the current font; it replies with the font name. (iTerm2 does not necessarily support the query.) |
per-fact attribution:
agent: curl -H 'accept: application/json' wire.phall.io/terminal-osc/50
or /terminal-osc/50.json