reset

Reinitialize terminal to sane state

TLDR

Reinitialize the current terminal
$ reset
Display the terminal type without reinitializing
$ reset -q
Reset and print shell commands to set TERM
$ reset -s
Reset without sending terminal initialization strings
$ reset -I

SYNOPSIS

reset [-IQVcqrsw] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]

DESCRIPTION

reset reinitializes the terminal to its default state. When invoked as reset (as opposed to tset), it sets cooked and echo modes, turns off cbreak and raw modes, turns on newline translation, and resets unset special characters to their default values before sending terminal initialization strings. This is useful when the terminal becomes garbled from viewing binary files or other corruption.The command reads terminfo data for the terminal type (from TERM environment variable) and sends appropriate initialization sequences. If neither -c nor -w is given, both are assumed.

PARAMETERS

-q

Display terminal type without reinitializing
-c
Set control characters and modes
-e ch
Set erase character to ch
-i ch
Set interrupt character to ch
-k ch
Set kill character to ch
-I
Do not send terminal initialization strings
-Q
Do not display values for erase, interrupt, and line kill characters
-r
Print terminal type to stderr
-s
Print shell commands to set TERM
-V
Report ncurses version and exit
-w
Resize the window to match the size deduced via setupterm
-m mapping
Specify a mapping from a port type to a terminal

INSTALL

sudo apt install ncurses-bin
sudo dnf install ncurses
sudo pacman -S ncurses
sudo apk add ncurses
brew install ncurses
nix profile install nixpkgs#ncurses

CAVEATS

May not fix all terminal corruption; in some cases closing and reopening the terminal is necessary. On some systems, reset is a symbolic link to tset. Terminal type must be correctly set in TERM variable.

HISTORY

Part of the ncurses package, derived from original BSD tset command. Essential recovery tool since early Unix for restoring terminals after displaying binary data or when escape sequences corrupt the display state.

SEE ALSO

tset(1), clear(1), stty(1), tput(1)