31

Out of curiosity, when your shell character set breaks from doing something like cat /dev/urandom is there a way to fix that in place?

200_success
  • 4,830

3 Answers3

51

Try one of these:

stty sane

or

reset

If both don't work, or your terminal is so messed up that you can't even enter commands, then it is best to close the terminal and start a new one.

Note that stty sane is defined by POSIX whereas reset is not. That means on some systems there might not be a reset or it might do something completely different, like resetting the entire system. I have not yet encountered a system without reset.

For more background information read "The Linux keyboard and console HOWTO" chapter "Resetting your terminal".

Lesmana
  • 2,324
20

You can try using the reset command.

user9517
  • 117,122
11

The reset command should work.

Changaco
  • 890