s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
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 The command
that is, you want to send the two characters ESC c to the console.
Why is it that the display sometimes gets confused and gives you
a 24-line or 1-line screen, instead of the usual 25 lines?
Well, the main culprit is the use of
on some other VT (where 4 symbols are typed to cat : ESC, c, ENTER,
Ctrl-D) and refreshing the screen on /dev/tty2
(perhaps using ^L) will fix things. Of course the permanent fix
is to use the right termcap or terminfo entry.
Why is it that you sometimes get a lot of line-drawing characters, e.g., after catting a binary to the screen? Well, there are various character set changing escape sequences, and by accident your binary might contain some of these. The ESC c is a general reset, a cure for all, but if you know precisely what went wrong you can repair it without resetting other console attributes. For example, after
your shell prompt will be all line-drawing characters.
Now do (typing blindly)
and all is well again. (Three symbols typed to each cat :
^N (or ^O), ENTER, Ctrl-D.) To understand what is happening,
see `The console character sets' below.
If you loaded some strange font, and want to return to the default,
will do (provided you stored the default font in the default place).
If this default font does not contain an embedded Unicode map (and
gives the wrong symbols for accented characters), then say
For example, if I do
then I have a German keyboard, and the key left of the Enter key
gives me a-umlaut. This works, because the a-umlaut occurs
on the CP437 code page and the kernel Unicode map is initialized
to CP437, and my video card has a CP437 font built-in.
If I now load an ISO 8859-1 font with
then everything still works, because setfont invalidates the kernel
Unicode map (if there is no Unicode map attached to the font), and without
map the kernel goes directly to the font, and that is precisely correct
for an ISO 8859-1 system with iso01.f16 font.
But going back to the previous font with
gives capital Sigma's instead of a-umlaut - all accented letters
are mixed up because also this font has no embedded Unicode map. After
which loads the default Unicode map (which is right for the default
font) all works correctly again. Usually loadunimap is not
invoked directly, but via setfont . Thus, the previous two
commands may be replaced by
The Ethiopian fonts and the lat1u*.psf fonts have embedded
Unicode code map. Most of the others don't.
On old terminals output involving tabs may require a delay, and you have to say
(see stty(1)).
You can change the video mode using
loads the default map again, but it may well be difficult to type `-'!
An alternative is
Sometimes even the letters are garbled. It is useful to know that there
are four main types of keyboards: QWERTY, QWERTZ, AZERTY and DVORAK.
The first three are named after the first six letter keys, and roughly
represent the English, German and French speaking countries.
Compared to QWERTY, the QWERTZ map interchanges Y and Z.
Compared to QWERTY, the AZERTY map interchanges Q and A, W and Z, and has
its M right of the L, at the semicolon position.
DVORAK has an entirely different letter ordering.
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 (
Next Previous Contents |