Follow up on How to reset a broken TTY?, to fix the terminal after displaying a binary file,
I've tried all solution there, as well as those from
But my case is still not covered --
- the command clear is not clearing screen
- using arrow-up key to see previous commands, but if there is a shorter command comes after a longer one, the longer part still remains
to reproduce the case:
cat /bin/ls
clear
# clear is not clearing screenHow to fix that?
PS, my system:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux bullseye/sid
Release: testing
Codename: bullseye
$ echo $TERM
screenI.e., it's screen session running under xterm.
1 Answer
Use reset command.
Simply type reset and press Enter a few times.
If this doesn't work then your TERM environment variable is not set correctly for some reason. Try export TERM=xterm then do reset again. To permanently fix it you may need to put export TERM=xterm in your ~/.bashrc or similar.