I was using a Linux console and suddenly the format of the letters changed:
I probably pressed on the wrong keys. Any idea how to fix this?
Such garbage may be an aftermath of a command that output binary data to your console. Usually you don't want commands to do this. Still it's possible due to a bug or some mistake. Example:
You wanted to
cat file where
file is a text file, you made a typo and run
cat fild where
fild happened to be a binary file.
In such scenario some particular byte sequences may be interpreted by your terminal emulator as control sequences or so, they will affect its later behavior.
To fix this:
man 1 reset:
When invoked as
tsetsets cooked and echo modes, turns off cbreak and raw modes, turns on newline translation and resets any unset special characters to their default values before doing the terminal initialization described above. This is useful after a program dies leaving a terminal in an abnormal state. Note, you may have to type
(the line-feed character is normally control-J) to get the terminal to work, as carriage-return may no longer work in the abnormal state. Also, the terminal will often not echo the command.
So the more foolproof version of the command seems to be:
My experiences (particularly in
tmux) show in some cases
reset may not help; still it usually does.