RIS
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
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
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
| Specification | Section |
|---|---|
| VT510 Reference | — |
| ECMA-48 | §8.3.105 |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | Yes | Handler reset_state() at term/mod.rs:1835 |
| Bobcat | ✓ | 0.9.0 | HardReset() and SoftReset() methods in Terminal.cpp confirm support |
| contour | ✓ | v0.1.0 | ESC c (RIS) implemented; calls Terminal::hardReset() |
| foot | ✓ | Yes | Implemented in vt.c:480-481 as ESC c |
| Ghostty | ✓ | v1.0.0 | ESC c handled in stream.zig:2260-2265 |
| iTerm2 | ✓ | Yes | |
| Kitty | ✓ | Yes | |
| Konsole | ✓ | Yes | |
| mintty | ✓ | Yes | Handled 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 | ✓ | Yes | Handled in performer.rs:679 via EscCode::FullReset (ESC c), performs comprehensive terminal reset |
| Windows Terminal | ✓ | Yes | ESC c dispatches HardReset() in OutputStateMachineEngine.cpp:232-233 |
| xterm | ✓ | Yes | Implemented in charproc.c:6142 via VTReset() |
| xterm.js | ✓ | 3.5.0 | |
| Multiplexers | |||
| cy | ✓ | v0.1.0 | |
| GNU Screen | ✓ | v.4.2.0 | RIS (ESC c) implemented in DoESC() at src/ansi.c:733 |
| tmux | ✓ | 1.3 | Full terminal reset including palette and screen |
| tuios | ✓ | v0.0.15 | |
| Zellij | ✓ | v0.5.0-beta | |