How to reset a broken TTY?

Solution 1:

Run echo ^v^o, that is echo and then Ctrl-v and then Ctrl-o, Enter. You will not see the Ctrl-v. It will display as echo ^O. Ctrl-v sets it into verbose mode, passing through control characters, and the Ctrl-o will reset the terminal.

Solution 2:

Usually, running reset resets the terminal. Some key bindings from .inputrc might be lost, though.

Solution 3:

You can try the ANSI reset command:

printf "\033c"

Solution 4:

My terminal didnt display any characters I typed. None of the other tricks worked. This one works:

stty sane

Worked for me. I sometimes have a terminal in an unresponsive state, but none of the other suggestions could give me the output back again. The other suggestions I tried, but didn't work:

echo ^v^o
reset
printf "\033c"

Source: https://unix.stackexchange.com/a/79686/53236