SGR 49 — Default background color
Reset only the background color (leaves attributes + fg intact).
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\\x1b[
\x1b[49m\\033[
\033[49m\\e[
\e[49mESC [
ESC [ 4 9 mhex
1b 5b 34 39 6dDescription
Restores the background to the terminal's theme default without disturbing the foreground, bold/italic/underline, or other SGR state. The complement of `\x1b[39m` (default foreground). Commonly used to end a 'banner' line (colored background) and return to the normal terminal background without resetting text color.
Spec citation: ECMA-48 §8.3.117 (SGR parameter 49)
Examples
printf '\033[41;37m WARNING \033[49m text\033[0m\n'print('\x1b[41mred bg\x1b[49m default bg\x1b[0m')fmt.Print("\x1b[41mred bg\x1b[49m default bg\x1b[0m")console.log('\x1b[41mred bg\x1b[49m default bg\x1b[0m')printf("\x1b[41mred bg\x1b[49m default bg\x1b[0m\n");Terminal support
- xterm
- yes
- Linux console (fbcon)
- yes
- macOS Terminal.app
- yes
- iTerm2
- yes
- Windows Terminal
- yes
- cmd.exe / ConPTY
- yes
- 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 | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | no | no |