OSC 110 / 111 / 112 — Reset default fg / bg / cursor colour
Restore the terminal's user-default foreground, background, or cursor colour after OSC 10 / 11 / 12 overrode it.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\x1b]110\x07 (reset fg) \x1b]111\x07 (reset bg) \x1b]112\x07 (reset cursor)\033]110\007 / \033]111\007 / \033]112\007\e]110\a / \e]111\a / \e]112\aESC ] N BEL1b 5d 31 31 30 / 31 31 31 / 31 31 32 07Description
The reset partners of OSC 10 / 11 / 12 (set fg / bg / cursor colour). Sending one of these with no payload restores the value to whatever the user configured in their terminal preferences — much friendlier than guessing what to pass to OSC 10/11/12 to undo a temporary override. Apps that briefly remap default colours (theme-switchers, demos, terminal-recorders that need to capture a clean baseline) should always emit the corresponding `11X` on exit. OSC 112 is xterm-specific for the cursor; iTerm2 also supports it. Sending `\x1b]110\x07` is exactly equivalent to `\x1b]10;?\x07` followed by re-emitting whatever was queried — but with one round-trip-free byte.
Spec citation: xterm-ctlseqs (OSC 110 / 111 / 112)
Examples
printf '\033]11;#000000\007' # override bg to pure black\n# … later …\nprintf '\033]111\007' # restore user default bgimport sys; sys.stdout.write('\x1b]111\x07')fmt.Print("\x1b]111\x07")process.stdout.write('\x1b]111\x07')printf("\x1b]111\x07");Terminal support
- xterm
- yes
- Linux console (fbcon)
- no
- macOS Terminal.app
- partial
- iTerm2
- yes
- Windows Terminal
- yes
- cmd.exe / ConPTY
- no
- kitty
- yes
- alacritty
- yes
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- yes
- Konsole
- yes
- tmux
- no
- GNU screen
- no
| xterm | Linux console (fbcon) | macOS Terminal.app | iTerm2 | Windows Terminal | cmd.exe / ConPTY | kitty | alacritty | WezTerm | Ghostty | GNOME Terminal | Konsole | tmux | GNU screen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| yes | no | partial | yes | yes | no | yes | yes | yes | yes | yes | yes | no | no |
Related sequences
In the family cookbook
SGR cookbook · 5. OSC palette override — repaint the slot itself