Recover a terminal session

From LQWiki
Jump to navigation Jump to search

If your terminal is covered in garbage, and/or not responding, here are a few things you can do:

  • If none of the keys appear to work, "echo" may have been turned off. You can clear this sort of problem by carefully typing:
^Jstty sane^J

(where ^J means hold the Ctrl key while tapping the J key).

  • If upper-case letters display properly but lower-case are displayed as graphics characters, you can turn the graphics off with this command:
echo -e "\017"

or

echo ^V^O

where one types Control-V and then Control-O*. *Note that Control-V allows a normally nonprinting control character to be entered without the control character taking effect. For example, entering ^V^C into an editor will not quit the editor but allow you to insert the control character instead

  • If you can type things but want to clear the screen, press ^L or run the "clear" command.
  • If your terminal settings are still not correct, try running the "reset" command.
  • You can also try echo -e "\\033c";tput is2;stty sane line 1

See also