OSC 110/111/112
OSC 110, OSC 111, and OSC 112 reset the terminal's default foreground color, background color, and cursor color to their configured defaults. They are the counterparts to OSC 10, OSC 11, and OSC 12 respectively.
Syntax
OSC 110 ST Reset default foreground color
OSC 111 ST Reset default background color
OSC 112 ST Reset cursor color
OSC110 = 0x1b, "]", "110", ( 0x07 | 0x1b, "\\" ) ; OSC111 = 0x1b, "]", "111", ( 0x07 | 0x1b, "\\" ) ; OSC112 = 0x1b, "]", "112", ( 0x07 | 0x1b, "\\" ) ;
Description
These sequences undo color changes made by their corresponding OSC set/query sequences:
| Sequence | Resets | Counterpart |
|---|---|---|
| OSC 110 | Default foreground (text) color | OSC 10 |
| OSC 111 | Default background color | OSC 11 |
| OSC 112 | Cursor color | OSC 12 |
Each reset sequence takes no parameters. The color reverts to whatever the terminal's configuration specifies as the default. This is the color that was in effect before any OSC 10/11/12 sequences were processed.
These sequences are particularly useful for applications that temporarily change the terminal's appearance (for example, to implement a dark/light theme toggle) and need to restore the original colors when the application exits.
There are additional reset sequences in the same range: OSC 113 resets the mouse foreground color, OSC 114 resets the mouse background color, OSC 115 resets the Tektronix foreground, OSC 116 resets the Tektronix background, and OSC 117 resets the highlight color. However, support for these is rare outside of XTerm.
Examples
# Change foreground to red, then reset it
printf '\e]10;#ff0000\e\\'
printf '\e]110\e\\'
# Change background to blue, then reset it
printf '\e]11;#0000ff\e\\'
printf '\e]111\e\\'
# Change cursor color to green, then reset it
printf '\e]12;#00ff00\e\\'
printf '\e]112\e\\'
# Reset all three at once
printf '\e]110\e\\' && printf '\e]111\e\\' && printf '\e]112\e\\'
Specifications
| Specification | Section |
|---|---|
| XTerm ctlseqs | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | Yes | OSC 110, 111, 112 all implemented |
| Bobcat | ? | ? | Would be handled by underlying TerminalCtrl library, not directly in Bobcat code |
| contour | ✓ | v0.1.0 | OSC 110 (RCOLORFG), 111 (RCOLORBG), and 112 (RCOLORCURSOR) are all implemented in Functions.h lines 642-643,641 and handled in Screen.cpp lines 4046-4048 |
| foot | ✓ | 1.4.0 | Supports OSC 110, 111, 112, 117, 119 |
| Ghostty | ✓ | v1.0.0 | OSC 110, 111, 112 all supported |
| iTerm2 | ✓ | Yes | OSC 110, 111, 112 reset foreground/background/cursor colors via XTERMCC_RESET_VT100_TEXT_*_COLOR tokens |
| Kitty | ✓ | Yes | Supports OSC 110, 111, 112, 117, 119 |
| Konsole | ✓ | Yes | OSC 110 (reset fg), 111 (reset bg), and 112 (reset cursor color) are all supported |
| mintty | ✓ | Yes | OSC 110/111/112 color resets implemented at src/termout.c:4726-4728 |
| mlterm | ✗ | No | Code is present but commented out with #if 0 |
| PuTTY | ✗ | No | |
| Rio | ✓ | v0.0.28 | OSC 110, 111, and 112 all supported for resetting foreground, background, and cursor colors |
| rxvt-unicode | ~ | 7.0 | OSC 39/49 reset fg/bg colors but not standard OSC 110/111/112 format |
| st | ✓ | 0.9.3 | |
| terminology | ✗ | No | Recognized but no implementation, only debug logging |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | OSC 110, 111, 112 all implemented |
| WezTerm | ✓ | 20220626-201802-61a01c91 | OSC 110-119 reset dynamic colors including foreground (110), background (111), and cursor (112) |
| Windows Terminal | ✓ | Yes | OSC 110, 111, 112, 117 for resetting foreground, background, cursor, and highlight colors |
| xterm | ✓ | xterm-88 | OSC 110/111/112 reset foreground/background/cursor color |
| xterm.js | ✓ | 4.16.0 | Includes OSC 110, 111, and 112 |
| Multiplexers | |||
| cy | ✗ | No | |
| GNU Screen | ✗ | No | |
| tmux | ✓ | 3.2 | Supports OSC 110, 111, 112 |
| tuios | ✓ | v0.0.15 | OSC 110/111/112 reset foreground/background/cursor colors |
| Zellij | ✗ | No | OSC 110/111/112 are explicitly marked as unimplemented (grid.rs:2828-2841) |
See also
- OSC 10 — Set/Query Foreground Color — Set default foreground color
- OSC 11 — Set/Query Background Color — Set default background color
- OSC 12 — Set/Query Cursor Color — Set cursor color
- OSC 104 — Reset Color Palette Entry — Reset indexed palette colors