Skip to main content

OSC 110/111/112

AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Experimental

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
Formal syntax
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:

SequenceResetsCounterpart
OSC 110Default foreground (text) colorOSC 10
OSC 111Default background colorOSC 11
OSC 112Cursor colorOSC 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.

note

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​

SpecificationSection
XTerm ctlseqs—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✓YesOSC 110, 111, 112 all implemented
Bobcat??Would be handled by underlying TerminalCtrl library, not directly in Bobcat code
contour✓v0.1.0OSC 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.0Supports OSC 110, 111, 112, 117, 119
Ghostty✓v1.0.0OSC 110, 111, 112 all supported
iTerm2✓YesOSC 110, 111, 112 reset foreground/background/cursor colors via XTERMCC_RESET_VT100_TEXT_*_COLOR tokens
Kitty✓YesSupports OSC 110, 111, 112, 117, 119
Konsole✓YesOSC 110 (reset fg), 111 (reset bg), and 112 (reset cursor color) are all supported
mintty✓YesOSC 110/111/112 color resets implemented at src/termout.c:4726-4728
mlterm✗NoCode is present but commented out with #if 0
PuTTY✗No
Rio✓v0.0.28OSC 110, 111, and 112 all supported for resetting foreground, background, and cursor colors
rxvt-unicode~7.0OSC 39/49 reset fg/bg colors but not standard OSC 110/111/112 format
st✓0.9.3
terminology✗NoRecognized but no implementation, only debug logging
VT100✗No
VTE✓YesOSC 110, 111, 112 all implemented
WezTerm✓20220626-201802-61a01c91OSC 110-119 reset dynamic colors including foreground (110), background (111), and cursor (112)
Windows Terminal✓YesOSC 110, 111, 112, 117 for resetting foreground, background, cursor, and highlight colors
xterm✓xterm-88OSC 110/111/112 reset foreground/background/cursor color
xterm.js✓4.16.0Includes OSC 110, 111, and 112
Multiplexers
cy✗No
GNU Screen✗No
tmux✓3.2Supports OSC 110, 111, 112
tuios✓v0.0.15OSC 110/111/112 reset foreground/background/cursor colors
Zellij✗NoOSC 110/111/112 are explicitly marked as unimplemented (grid.rs:2828-2841)

See also​