0

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 https://unix.stackexchange.com/questions/79684/

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 screen

How 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 screen

I.e., it's screen session running under xterm.

xpt
  • 9,385
  • 44
  • 120
  • 178

2 Answers2

3

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.

Giacomo1968
  • 58,727
LawrenceC
  • 75,182
0

What worked for me when I was sshed into another system, was just using exit and ssh again.

Noora
  • 11