Skip to main content
ansicode

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.

\\x1b[\x1bc
\\033[\033c
\\e[\ec
ESC [ESC c
hex1b 63

Description

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

bash
printf '\033c'   # full reset; same as tput reset
python
import sys; sys.stdout.write('\x1bc')
go
fmt.Print("\x1bc")
javascript
process.stdout.write('\x1bc')
c
printf("\x1bc");

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
no
GNU screen
no

Related sequences

In the family cookbook

ESC cookbook · 1. Hard reset vs. soft reset — `\x1bc` (RIS) and `\x1b[!p` (DECSTR)