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?
Try one of these:
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.
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
For more background information read "The Linux keyboard and console HOWTO" chapter "Resetting your terminal".
You can try using the reset command.