Skip to content

OSC 104 / 105 / 110-119 — Color Reset

SequenceOSC <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.

CodeResets
104Palette color N (or all 256 when no parameter)
105"Special" colors (OSC 5 slots — bold / underline / blink / reverse / italic)
110Foreground (OSC 10)
111Background (OSC 11)
112Cursor color (OSC 12)
113Mouse pointer fg (OSC 13)
114Mouse pointer bg (OSC 14)
115Tektronix fg (OSC 15)
116Tektronix cursor (OSC 16)
117Highlight (selection) bg (OSC 17)
118Tektronix bg (OSC 18)
119Highlight (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 fg

Difference from XTPOPCOLORS

MechanismWhere it restores toStack depth
OSC 104 / 110-119Configured default1 (no history)
CSI #Q (XTPOPCOLORS)The runtime value at the matching #P pushup 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.

Otty