Skip to main content

RIS

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!
Standard

RIS (Reset to Initial State) is an escape sequence that performs a complete terminal reset, restoring the terminal to its power-on default state.

Syntax​

ESC c         RIS — Reset to Initial State
Formal syntax
RIS = 0x1b, "c" ;

Description​

Per ECMA-48 §8.3.105, RIS "causes a device to be reset to its initial state, i.e. the state it has after it is made operational."

RIS is the most thorough reset available. On a typical terminal emulator, it performs all of the following:

  • Clears the screen and scrollback buffer
  • Moves the cursor to the home position (row 1, column 1)
  • Resets all character attributes (SGR) to normal
  • Resets all modes (DECOM, DECAWM, LNM, etc.) to their default states
  • Clears all tab stops and restores the default tab stops (every 8 columns)
  • Resets the scrolling region to the full screen
  • Resets character set designations to their defaults
  • Resets the saved cursor state (DECSC)
  • Switches to the main screen buffer if the alternate screen is active
warning

RIS is a heavy operation. For most purposes, the soft terminal reset CSI ! p (DECSTR) is preferred, as it resets modes and attributes without clearing the screen or scrollback.

The reset command​

The Unix reset command (typically part of ncurses) sends RIS along with other initialization sequences. It is commonly used to recover a terminal that has been left in a broken state (e.g., after a binary file has been accidentally cat'd).

Examples​

printf '\ec'     # Full terminal reset

Specifications​

SpecificationSection
VT510 Reference—
ECMA-48§8.3.105

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✓YesHandler reset_state() at term/mod.rs:1835
Bobcat✓0.9.0HardReset() and SoftReset() methods in Terminal.cpp confirm support
contour✓v0.1.0ESC c (RIS) implemented; calls Terminal::hardReset()
foot✓YesImplemented in vt.c:480-481 as ESC c
Ghostty✓v1.0.0ESC c handled in stream.zig:2260-2265
iTerm2✓Yes
Kitty✓Yes
Konsole✓Yes
mintty✓YesHandled in do_esc() at src/termout.c:1975-1981
mlterm✓rel-0_2_1
PuTTY✓0.45
Rio✓v0.0.28
rxvt-unicode✓rxvt-unicode-1.2
st✓0.4
terminology✓v0.1.0
VT100✓Yes
VTE✓Yes
WezTerm✓YesHandled in performer.rs:679 via EscCode::FullReset (ESC c), performs comprehensive terminal reset
Windows Terminal✓YesESC c dispatches HardReset() in OutputStateMachineEngine.cpp:232-233
xterm✓YesImplemented in charproc.c:6142 via VTReset()
xterm.js✓3.5.0
Multiplexers
cy✓v0.1.0
GNU Screen✓v.4.2.0RIS (ESC c) implemented in DoESC() at src/ansi.c:733
tmux✓1.3Full terminal reset including palette and screen
tuios✓v0.0.15
Zellij✓v0.5.0-beta