RIS — Reset to Initial State (full terminal reset)
Hard reset the terminal: clear screen + scrollback, reset every mode and SGR, home the cursor.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\x1bc\033c\ecESC c1b 63Description
Reset to Initial State. Two bytes — ESC (0x1b) followed by c (0x63) — with no CSI introducer, no parameters. The terminal does the moral equivalent of a power cycle: clears the screen and (on most terminals) the scrollback, resets every SGR attribute and color, exits the alt screen, resets DEC private modes (auto-wrap on, cursor visible, mouse off, bracketed-paste off), resets character sets, and homes the cursor. This is what reset(1) and tput reset ultimately emit. Use it as a last-resort recovery when a crashed TUI has left the terminal in an unusable state — but be aware it also wipes scrollback in most modern terminals, which the gentler \x1b[!p (DECSTR, soft reset) does not.
Spec citation: ECMA-48 §8.3.105 (RIS) / xterm-ctlseqs (ESC c)
Examples
printf '\033c' # full reset; same as tput resetimport sys; sys.stdout.write('\x1bc')fmt.Print("\x1bc")process.stdout.write('\x1bc')printf("\x1bc");Frequently asked
Short answers to the questions developers actually search for this sequence.
- When should I use RIS (
\x1bc) instead of DECSTR (\x1b[!p) orclear? - Use RIS only as last-resort recovery from a corrupted terminal state — it clears the screen *and* scrollback, resets every SGR, every DEC private mode, tab stops, character sets, and on most terminals the palette. Use DECSTR to undo a TUI's mode + SGR changes while leaving the user's screen and scrollback intact — it's the surgical 'reset to defaults without losing history' option. Use
clear(which expands to\x1b[H\x1b[2J\x1b[3J) for the everyday 'wipe what's visible' need, without touching SGR or modes.
Terminal support
- xterm
- yes
- Linux console (fbcon)
- yes
- macOS Terminal.app
- yes
- iTerm2
- yes
- Windows Terminal
- yes
- cmd.exe / ConPTY
- partial
- kitty
- yes
- alacritty
- yes
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- yes
- Konsole
- yes
- tmux
- yes
- GNU screen
- yes
| 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 | partial | yes | yes | yes | yes | yes | yes | yes | yes |
Related sequences
In the family cookbook
ESC cookbook · 1. Hard reset vs. soft reset — `\x1bc` (RIS) and `\x1b[!p` (DECSTR)