Anyone who has used a
Unix/Linux system for any significant amount of time has invariably performed the classic
screw-up of trying to view a
binary file inside their
terminal. Depending on the
data viewed and the particular terminal program being used, this can do all kinds of odd things to your display, including:
- Turning off local echo, so everything you type becomes invisible
- Changing your window titlebar
- Resizing your window
- Placing text into some weird character mode, where every character is transliterated into a corresponding weird alien symbol
- On suitably configured systems, making your printer print stuff (I think this is some kind of print screen function).
In any case, after you have realised your mistake and hit
ctrl-c, your terminal nonetheless remains rather
monged out and unusable.
A lot of people simply close the window and open a new one, but the real solution to this is to reset your terminal. In the good old days people used real dumb terminals so resetting the terminal would involve physically resetting it. Nowadays we use programs that emulate physical terminals, but they usually retain a reset function to keep this functionality. There are several ways to do this:
- Type the 'reset' command. You may not be able to see (or read properly) while you type this, but afterwards your terminal should be put back into a sane state.
- In xterm, hold down the ctrl and middle click in the window to bring up a menu. There is the option given of soft and full reset of the terminal.
- In gnome-terminal, you can reset from the Terminal menu.
- In KDE's Konsole, select "Reset and Clear Terminal" from the "Edit" menu.