OSC 104
OSC 104 resets one or more color palette entries to their default values. It is the counterpart to OSC 4 (set color palette entry).
Syntax
OSC 104 ; c ST Reset color c to default
OSC 104 ST Reset all palette colors to defaults
OSC104 = 0x1b, "]", "104", [ ";", color-index, { ";", color-index } ], ( 0x07 | 0x1b, "\\" ) ;
color-index = digit, { digit } ;
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;Parameters
| Parameter | Description |
|---|---|
c | Color index (0-255) to reset. Multiple indices may be separated by ;. If omitted, all 256 palette colors are reset. |
Description
OSC 104 restores color palette entries to the terminal's built-in defaults, undoing any changes made with OSC 4. This is useful for applications that temporarily modify palette colors and need to restore the original colors on exit.
When called with no parameter, all 256 palette colors (indices 0-255) are reset to their defaults. When called with one or more color indices, only those specific entries are reset.
Multiple color indices can be specified in a single sequence, separated by semicolons. For example, OSC 104 ; 1 ; 2 ; 3 ST resets colors 1, 2, and 3 to their defaults.
The default palette varies by terminal but typically follows the standard 256-color scheme: 16 named colors (0-15), a 6x6x6 color cube (16-231), and a grayscale ramp (232-255).
Examples
# Reset color 1 (red) to its default
printf '\e]104;1\e\\'
# Reset colors 0-7 (standard colors) to defaults
printf '\e]104;0;1;2;3;4;5;6;7\e\\'
# Reset all palette colors to defaults
printf '\e]104\e\\'
# Using BEL as the string terminator
printf '\e]104;1\a'
Specifications
| Specification | Section |
|---|---|
| XTerm ctlseqs | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | Yes | |
| Bobcat | ? | ? | Would be handled by underlying TerminalCtrl library, not directly in Bobcat code |
| contour | ✓ | v0.1.0 | OSC 104 RCOLPAL (reset color palette) is implemented in Functions.h line 647 and handled in Screen.cpp line 4027 |
| foot | ✓ | 1.4.0 | |
| Ghostty | ✓ | v1.0.0 | |
| iTerm2 | ✓ | Yes | Handled via XTERMCC_RESET_COLOR token type |
| Kitty | ✓ | Yes | |
| Konsole | ✓ | Yes | |
| mintty | ✓ | Yes | OSC 104 palette reset implemented at src/termout.c:4698 |
| mlterm | ✓ | 3.6.2 | |
| PuTTY | ✗ | No | Not found in do_osc handler; only Linux palette sequences (OSC P/R) and OSC 4 query are implemented |
| Rio | ✓ | v0.0.28 | Resets all 256 colors when no parameter given, or specific indices when provided |
| rxvt-unicode | ✗ | No | OSC 39/49 (restoreFG/restoreBG) provide similar functionality but not standard OSC 104 |
| st | ✓ | 0.8.3 | |
| terminology | ✗ | No | |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | |
| WezTerm | ✓ | 20200202-181957-765184e5 | Reset color palette entries |
| Windows Terminal | ✓ | Yes | |
| xterm | ✓ | xterm-88 | Reset color palette entry (OSC 104) |
| xterm.js | ✓ | 4.16.0 | |
| Multiplexers | |||
| cy | ✓ | v0.11.0 | |
| GNU Screen | ✗ | No | |
| tmux | ✓ | 2.4 | |
| tuios | ✗ | No | |
| Zellij | ✓ | v0.16.0 | Supports both resetting individual color indices and all colors when no parameters given |
See also
- OSC 4 — Change Color Palette Entry — Set a palette color
- OSC 110/111/112 — Reset Foreground/Background/Cursor Color — Reset special colors