# Reset Special Colors (OSC 105)

> Put xterm's special colors back as they started.

- **Sequence:** `OSC 105 ; Pc 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)
- **xterm:** [Operating System Commands](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)

`OSC 105 ; Pc ST` puts [special color](https://control-codes.page/osc/special-colors/index.html.md) `Pc` back as the
terminal started it, undoing `OSC 5`. `Pc` is `0` to `4`, for bold,
underline, blink, reverse and italic, and with none, `OSC 105 ST`, all five
are reset. It is [OSC 104](https://control-codes.page/osc/reset-palette/index.html.md) with the numbering moved up
by 256, and is read the same way, stopping at the first thing in the list
that is not a number ([`ResetAnsiColorRequest`](https://github.com/ThomasDickey/xterm-snapshots/blob/xterm-411a/misc.c#L3051-L3086)). The same colors can be reset as palette
numbers 256 to 260 with OSC 104.

Each special color starts as the default foreground, so in the terminal the
cases run in, set up as a default xterm, a reset one is reported as black.

libghostty-vt has no special colors, and ignores `OSC 5` and `OSC 105`, so
the cases that ask are known differences.

## Validation

### OSC105-1: Reset one

*A known difference: libghostty-vt does not pass this case.*

Input, one step per line:

```text
\e]5;0;red;1;blue\a  # bold and underline
\e]105;0\a
\e]5;0;?;1;?\a
```

Expected screen:

```text
|____|
reply \e]5;0;rgb:0000/0000/0000\a\e]5;1;rgb:0000/0000/ffff\a
```

### OSC105-2: Reset them all

*A known difference: libghostty-vt does not pass this case.*

Input, one step per line:

```text
\e]5;0;red;1;blue\a
\e]105\a
\e]5;0;?;1;?\a
```

Expected screen:

```text
|____|
reply \e]5;0;rgb:0000/0000/0000\a\e]5;1;rgb:0000/0000/0000\a
```

### OSC105-3: Through OSC 104, as color 256

*A known difference: libghostty-vt does not pass this case.*

Input, one step per line:

```text
\e]5;0;red\a
\e]104;256\a
\e]5;0;?\a
```

Expected screen:

```text
|____|
reply \e]5;0;rgb:0000/0000/0000\a
```

### OSC105-4: Nothing on screen

Input, one step per line:

```text
A
\e]5;0;red\a
\e]105;0\a
B
```

Expected screen:

```text
|AB__|
cursor 1,3
```

---

This is the Markdown version of <https://control-codes.page/osc/reset-special-colors/>. 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>.
