Previous Next Contents

4. Resetting your terminal

There is garbage on the screen, or all your keystrokes are echoed as line drawing characters. What to do?

Many programs will redraw the screen when ˆL is typed. This might help when there is some modem noise or broadcast message on your screen. The command clear will clear the screen.

The command reset will reset the console driver. This helps when the screen is full of funny graphic characters, and also if it is reduced to the bottom line. If you don't have this command, or if it does something else, make your own by putting the following two lines in an executable file reset in your PATH:

#!/bin/sh
echo -e \\033c
that is, you want to send the two characters ESC c to the console. If you loaded some strange font, and want to return to the default,
% setfont
will do (provided you stored the default font in the default place). On old terminals output involving tabs may require a delay, and you have to say
% stty tab3
(see stty(1)). You can change the video mode using resizecons or SVGATextMode. This usually settles the output side. On the input side there are many things that might be wrong. If X or DOOM or some other program using raw mode crashed, your keyboard may still be in raw (or mediumraw) mode, and it is difficult to give commands. (See "How to get out of raw mode" below.)

4.1 Keyboard hardware reset

Things may be wrong on a lower level than Linux knows about. There are at least two distinct lower levels (keyboard and keyboard controller) where one can give the command "keyboard disable" to the keyboard hardware. Keyboards can often be programmed to use one out of three different sets of scancodes.

However, I do not know of cases where this turned out to be a problem.

Some keyboards have a remapping capability built in. Stormy Henderson (stormy@Ghost.Net) writes: `If it's your keyboard accidently being reprogrammed, you can (on a Gateway AnyKey keyboard) press control-alt-suspend_macro to reset the keys to normal.'


Previous Next Contents