Appearance
OSC 104 / 105 / 110-119 — Color Reset
| Sequence | OSC <code> [; Ps]* ST |
| Otty support | ✓ 104 / 110 / 111 / 112 · ✓ 105 / 117 / 119 · 113 / 114 / 115 / 116 / 118 parsed but no visible effect (matches the unset-by-design slots in OSC 10-19) |
Description
Reset companions for the OSC 4 palette set and the OSC 5 / 10-19 named-color set sequences. The reset brings the slot back to the configured default (the terminal's startup palette / theme) — not to whatever the program saved earlier. For "restore exactly the prior runtime value", use XTPOPCOLORS instead.
| Code | Resets |
|---|---|
| 104 | Palette color N (or all 256 when no parameter) |
| 105 | "Special" colors (OSC 5 slots — bold / underline / blink / reverse / italic) |
| 110 | Foreground (OSC 10) |
| 111 | Background (OSC 11) |
| 112 | Cursor color (OSC 12) |
| 113 | Mouse pointer fg (OSC 13) |
| 114 | Mouse pointer bg (OSC 14) |
| 115 | Tektronix fg (OSC 15) |
| 116 | Tektronix cursor (OSC 16) |
| 117 | Highlight (selection) bg (OSC 17) |
| 118 | Tektronix bg (OSC 18) |
| 119 | Highlight (selection) fg (OSC 19) |
OSC 104 — Palette reset
bash
# Reset palette index 1 (red) to config default
printf '\e]104;1\e\\'
# Reset everything 0–255 at once (no parameter)
printf '\e]104\e\\'
# Reset multiple indices in one shot
printf '\e]104;1;3;5\e\\'OSC 105 — Reset special colors
bash
# Reset all five OSC 5 special slots
printf '\e]105\e\\'
# Reset just the underline-color special (slot 1)
printf '\e]105;1\e\\'OSC 110-119 — Named reset
Single-slot, no parameters:
bash
printf '\e]110\e\\' # OSC 110 — reset fg
printf '\e]111\e\\' # OSC 111 — reset bg
printf '\e]112\e\\' # OSC 112 — reset cursor
printf '\e]117\e\\' # OSC 117 — reset selection bg
printf '\e]119\e\\' # OSC 119 — reset selection fgDifference from XTPOPCOLORS
| Mechanism | Where it restores to | Stack depth |
|---|---|---|
| OSC 104 / 110-119 | Configured default | 1 (no history) |
| CSI #Q (XTPOPCOLORS) | The runtime value at the matching #P push | up to 10 |
In short: 104/110-119 forget all runtime changes; XTPOPCOLORS forgets only the most recent layer. Programs that want to leave a user's previous-runtime tweaks alone (Otty themes set OSC 4 before launch, for instance) should prefer XTPUSH/POP.
Related
- OSC 10/11/12/17/19 — set companions.
- OSC 4 — set palette index.
- CSI #P/Q/R — XTPUSHCOLORS