# Set Fonts (OSC 710 to 713)

> Set rxvt-unicode's normal, bold, italic or bold italic font, or ask for it.

- **Sequence:** `OSC 710 ; Pt ST`
- **ECMA-48:** [§8.3.89 OSC – Operating System Command, p. 51](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n64/mode/1up)
- **Specification:** [urxvt(7), XTerm Operating System Commands](http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#XTerm_Operating_System_Commands)

rxvt-unicode sets its four fonts with four numbers:

| Number | Font |
| --- | --- |
| `OSC 710 ; Pt ST` | normal, the same as [OSC 50](https://control-codes.page/osc/font/index.html.md) |
| `OSC 711 ; Pt ST` | bold |
| `OSC 712 ; Pt ST` | italic |
| `OSC 713 ; Pt ST` | bold italic |

`Pt` is a font set, as on rxvt-unicode's command line. `OSC 71x ; ? ST`
asks for one, and the answer, `OSC 71x ; font` ended the way the request
was, gives the font only when rxvt-unicode runs in its insecure mode and is
empty otherwise. 711 to 713 need rxvt-unicode built with its styles
([`urxvt(7)`](http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#XTerm_Operating_System_Commands)).

A default xterm has no `OSC 710` and ignores it
([the OSC numbers it knows](https://github.com/ThomasDickey/xterm-snapshots/blob/xterm-411a/misc.c#L3476-L3504)).
The cases follow xterm.

libghostty-vt does not recognize `OSC 710` either: its OSC parser in
`osc.zig` has no state for the number, so the string is dropped, and the
cases pass. The same holds for 711, 712 and 713.

## Support

| Terminal | Version | Support | Notes |
| --- | --- | --- | --- |
| VT220 | [manual](https://vt100.net/docs/vt220-rm/), 2nd ed., 1984 | No | OSC is not among the controls it recognizes ([§4.2](https://vt100.net/docs/vt220-rm/chapter4.html#S4.2)) |
| VT510 | [manual](https://vt100.net/docs/vt510-rm/), 1st ed., 1993 | No | ignores an OSC string ([chapter 4](https://vt100.net/docs/vt510-rm/chapter4.html)) |
| xterm | patch 412, [xterm-411a](https://github.com/ThomasDickey/xterm-snapshots/tree/xterm-411a) | No | ignored |
| libghostty-vt | [83edd49](https://github.com/ghostty-org/ghostty/tree/83edd491e3024ae5e50393d62877b8897da1cccd) | No | ignored |
| Konsole | 26.11.70, [a24c3d71](https://invent.kde.org/utilities/konsole/-/tree/a24c3d71be3684f24d030aa2dbe9bd723d985233) | No | not among the OSC numbers it handles ([`Vt102Emulation.h`](https://invent.kde.org/utilities/konsole/-/blob/a24c3d71be3684f24d030aa2dbe9bd723d985233/src/Vt102Emulation.h#L189-L205)) |
| ConEmu | build 230724, its [documentation](https://conemu.github.io/en/AnsiEscapeCodes.html) | No | not in its [ANSI escape codes](https://conemu.github.io/en/AnsiEscapeCodes.html) |
| rxvt-unicode | 9.31, [`urxvtperl(3)`](https://manpages.debian.org/testing/rxvt-unicode/urxvtperl.3.en.html) | Yes | 710 to 713; the query is answered only in insecure mode ([`urxvt(7)`](http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#XTerm_Operating_System_Commands)) |

## Validation

### OSC710-1: Setting a font changes nothing on screen

Input, one step per line:

```text
A
\e]710;xft:monospace:size=12\a
\e]711;xft:monospace:bold\a
B
```

Expected screen:

```text
|AB____|
cursor 1,3
reply none
```

### OSC710-2: A query is not answered

Input, one step per line:

```text
\e]710;?\a\e]713;?\a
```

Expected screen:

```text
|______|
reply none
```

---

This is the Markdown version of <https://control-codes.page/osc/urxvt-font/>. On that page every validation case runs live in libghostty-vt, the terminal emulation core of Ghostty, compiled to WebAssembly.

The validation cases are written in the notation described in <https://control-codes.page/notation/index.html.md>.
