libkeymap: Do not dump diacr values if lk_dump_keymap called
[platform/upstream/kbd.git] / doc / console.docs
1 Path: cwi.nl!sun4nl!EU.net!news.sprintlink.net!sunic!sunic.sunet.se!news.funet.fi!news.helsinki.fi!usenet
2 From: Peter Jones <thanatos@drealm.org>
3 Newsgroups: comp.os.linux.announce
4 Subject: Linux Console Terminal Documentation
5 Followup-To: comp.os.linux.misc
6 Date: Sat, 30 Sep 95 16:37:05 GMT
7 Organization: ?
8 Lines: 331
9 Approved: linux-announce@news.ornl.gov (Lars Wirzenius)
10 Message-ID: <cola-liw-812479025-13056-1@oravannahka.helsinki.fi>
11 NNTP-Posting-Host: kruuna.helsinki.fi
12 Mime-Version: 1.0
13 Content-Type: text/plain; charset=ISO-8859-1
14 Content-Transfer-Encoding: 8bit
15
16 -----BEGIN PGP SIGNED MESSAGE-----
17
18 I thought I'd do "something" for the Linux community (apart from
19 co-authoring drealmBBS :-)).
20
21 So, here's my first (and maybe only) issue of the Linux Console Driver
22 documentation.  Anyone wanting to take this on as a support task, feel
23 free - I _really_ don't have time to keep up with new 1.3.x kernels.
24
25 - -- Peter
26
27 Linux Console Driver
28 ====================
29 ====================
30 (Everything you ever wanted to know but couldn't be bothered to look in the
31 source for.)
32
33 Author: Peter L Jones <thanatos@drealm.org>
34 ~Date: Wed Sep 27 19:12:25 BST 1995
35 Kernel: 1.2.13
36 Addendum for: 1.3.28
37
38
39 General Processing
40 ==================
41 I don't use UTF.  I've only covered it to the extent I can fathom from the
42 source.
43
44 I've not documented "hardware scrollback".
45
46 In UTF mode, once a complete character is assembled, it is translated.
47
48 Otherwise, the character then has its top bit set if requested and is then
49 translated.
50
51 A glyph is to be displayed if
52         * we've assembled a complete UTF character
53         * we translated it okay
54         * it's not a control character, or we're displaying control
55           characters
56 Otherwise, it might be a control character.
57 Otherwise it's ignored.
58
59
60 Glyphs
61 ======
62 These are characters that make a mark on the display.
63
64 You can never display the glyph for char(27) by transmitting ESC.
65
66 You cannot display glyphs for any character in the Control Characters table,
67 unless enabled.
68
69 If there is a "pending newline"
70         a crlf sequence is issued prior to the glyph.
71
72 If we're in "insert mode",
73         the rest of the line is shifted right; the character in the
74         last column is lost.
75
76 The glyph is then displayed.
77
78 If the cursor is in the last column,
79         If automatic margins are turned on,
80                 the "pending newline" state is set
81         otherwise,
82                 the next glyph can overwrite this one.
83 Otherwise the cursor is advanced.
84
85
86 Control Characters
87 ==================
88 Control characters can occur during ESCape sequence processing.
89
90 ^g              bell - make a tone on the console speaker
91 ^h              bs - cursor to previous character (backspace)
92                 (will not wrap to previous line)
93 ^i              tab - cursor to next tab position
94 ^j ^k ^l        lf - cursor to next line, scroll if end of scrolling region
95                 (linefeed); if CRLF mode select, cr as well
96 ^m              cr - cursor to start of current line (carriage return)
97 ^n              charset 1, translate table G1, display control characters
98                 as glyphs
99 ^o              charset 0, translate table G0, don't display control
100                 characters as glyphs
101 {-- "charset" sets the current translate table; e.g. ^n sets charset
102 1, translate table G1, display control characters as glyphs - followed by
103 ^[[10m would leave G1 in effect but disable display of control characters as
104 glyphs and display setting the top bit of glyphs --}
105
106 ^x ^z           cancel any ESCape sequence in progress
107 ^[              begin an ESCape sequence
108 ^?              "delete" - ignored
109 128+^[          begin a CSI sequence
110
111
112 ESCape Sequences
113 ================
114 ^[[             begin a CSI sequence
115 ^[%             begin a UTF control sequence
116 ^[(             begin a set G0 sequence
117 ^[)             begin a set G1 sequence
118 ^[#             begin a DEC test sequence
119 ^[E             cr, lf
120 ^[M             ri - cursor up, reverse scroll if top of scrolling region
121                 (reverse index)
122 ^[D             lf
123 ^[H             set tab in the current column
124 ^[Z             request for terminal ID (response is ^[[?6c - VT102)
125 ^[7             store cursor position
126 ^[8             restore cursor position
127 ^[c             reset terminal completely
128 ^[>             Keypad is numeric (normal)
129 ^[=             Keypad is application (act as function keys)
130
131
132 CSI sequences
133 =============
134
135 There are two formats.  Function keys are indicated by CSI [ and are dealt
136 with later.  The general format is CSI (i.e. ^[[), zero to 16 parameters and
137 a character to indicate the function being performed.  E.g ^[[1;43;37m.
138
139 Missing parameters are defaulted.  Screen co-ordinates and movements start
140 at and default to 1 (unless otherwise stated).  Parameters are named par1,
141 par2 etc in the following descriptions.
142
143 CSI h and CSI l can have an optional ? after the CSI and before any
144 parameters.  This indicates "DEC Private" modes.  {-- Other manufacturers
145 use different characters to select their private modes - Linux doesn't
146 support any but DEC. --}
147
148 CSI h           Set Mode sequence
149 CSI l           Clear Mode sequence
150 CSI n           Request report:
151                 par1 = 5 - Status report: response is ^[[0n (terminal okay)
152                 par1 = 6 - Cursor report: response is ^[[y;xR - where y is
153                 relative if origin mode is selected
154 CSI A           Cursor Up by par1 lines
155 CSI F           Cursor Up by par1 lines, and to start of line
156 CSI B CSI e     Cursor Down by par1 lines
157 CSI E           Cursor Down by par1 lines, and to start of line
158 CSI C CSI a     Cursor Right by par1 characters
159 CSI D           Cursor Left by par1 characters
160 CSI d           Set cursor vertical position to par1
161 CSI G CSI `     Set cursor horizonal position to par1
162 CSI H CSI f     Set cursor vertical position to par2 and horizontal position
163                 to par1
164 CSI L           Insert par1 lines
165 CSI M           Delete par1 lines
166 CSI @           Insert par1 characters
167 CSI P           Delete par1 characters
168 CSI X           Erase par1 characters (wraps around line ends)
169 CSI J           Screen Erase sequence:
170                 par1 = 0 - erase from cursor to end of display
171                 par1 = 1 - erase from start of display to cursor
172                 par1 = 2 - erase whole display
173 CSI K           Line Clear sequence:
174                 par1 = 0 - erase from cursor to end of line
175                 par1 = 1 - erase from start of line to cursor
176                 par1 = 2 - erase whole line
177 CSI c           If par1 = 0 (default), requests terminal ID
178                 (response is ^[[?6c - VT102)
179 CSI g           Clear tabs:
180                 par1 = 0 - Clears tab at the current column
181                 par1 = 3 - Clears all tabs
182 CSI q           Set LEDs = par1 indicates which LED to turn on -
183                 0 - none, 1 - , 2 - , 3 - .
184 CSI r           Set scrolling region
185                 par1 - top, default and minimum 1, must be less than par2
186                 par2 - bottom, default and maximum end of display
187 CSI s           Store cursor position
188 CSI u           Restore cursor position
189 CSI m           Character Rendition sequence
190 CSI ]           setterm(1) command sequence
191
192
193 Set and Clear Mode Sequences
194 - ----------------------------
195 CSI h sets modes; CSI l clears modes.  There are two sets of modes -
196 ANSI standard and DEC private.
197
198 ANSI modes:
199 3       Monitor (display control characters)
200 4       Insert
201 20      CRLF
202
203 DEC modes:
204 1       Cursor keys as application keys (send ^[Ox as appl, ^[[x as normal)
205 3       80 (off) or 132 (on) columns
206 5       Inverse video
207 6       Origin mode (and go to origin)
208 7       Autowrap (right margin)
209 8       Autorepeat
210 9       Mouse reports #1
211 25      Cursor visible
212 1000    Mouse reports #2
213
214
215 Character Rendition Sequences
216 - -----------------------------
217 Each parameter is actioned in order.  You cannot get bright backgrounds
218 (rather, I can't).  {-- On SVR4, attribute code 6 is used for bright
219 background, if I remember correctly --}
220
221 0       default (intensity normal, underline off, blink off, normal video,
222         default colours (which start as white on black))
223 1       intensity bold
224 2       intensity dim
225 4       underline on
226 5       blink on
227 7       reverse video
228 10      restore translate table, turn off display of control chars, don't
229         set the "top" bit of glyphs displayed
230 11      disable the translate table, display control chars as glyphs, don't
231         set the "top" bit of glyphs displayed
232 12      disable the translate table, display control chars as glyphs,
233         set the "top" bit of glyphs displayed
234 21 22   intensity normal
235 24      underline off
236 25      blink off
237 27      normal video
238 38      underline on, set foreground colour to default
239 39      underline off, set foreground colour to default
240 49      set background colour to default
241 30-37   set foreground colour (0-black, 1-red, 2-green, 3-brown, 4-blue,
242         5-magenta, 6-cyan, 7-white)
243 40-47   set background colour
244
245
246 Setterm Commmand Sequences
247 - --------------------------
248 The command is in par1, followed by parameters.
249
250 1       Set underline colour - par2 is 0 to 15, which is 0 to 7 as above,
251         plus bold versions
252 2       Set dim colour - par2 as above
253 8       Store current attributes as defaults (so that CSI 0 m restores to
254         them)
255 9       Set blanking interval to par2 minutes (max one hour)
256
257
258 UTF Control Sequences
259 =====================
260 ^[%@            Turn off UTF
261 ^[%G ^[%8       Turn on UTF (^[%8 is deprecated)
262
263
264 G0/G1 Sequences
265 ===============
266 There are two character sets, known as G0 and G1.  G0 is the default
267 character set.  Each can be set to one of four mappings.  The mappings, and
268 the sequences to select them, are:
269
270  G0   G1  Map  Name
271 - ---- ---- ---  ----
272 ^[(B ^[)B  0   Normal Map (default G0 map)
273 ^[(0 ^[)0  1   Graphics Map (default G1 map)
274 ^[(U ^[)U  2   Null Map
275 ^[(K ^[)K  3   User Map
276
277 The maps themselves are defined in "consolemap.c".  "Normal Map" translates
278 the standard IBM PC ROM character set to standard 8-bit ISO Latin-1. 
279 "Graphics Map" translates to the VT100 character set in graphics mode. 
280 "Null Map" passed the ROM characters straight through, except BS, CR, LF,
281 LL, SO, SI and ESC.  "User Map" is available to be changed in the source or
282 by mapscrn(8).
283
284
285 DEC Test Sequences
286 ==================
287 Only one test, ^[#8, is defined.  This fills the display with the character
288 'E' to allow the display to be centred.
289
290
291 Addendum
292 ========
293 The console driver changed in 1.3.x.  This documents the changes between
294 1.2.13 and 1.3.28.
295
296 Each virtual console gains a palette, which defines the actual colours used
297 on the display (so you can get yellow rather than brown, for example).
298
299 Font support is enhanced.
300
301 In addition to ESC, some other control characters cannot have their glyphs
302 displayed - ^@ ^H ^J ^L ^M ^N ^O ^[.
303
304 Hardware scrollback has been enhanced.
305
306 The "Normal Map" has been renamed "Latin 1 Map" (LAT1_MAP).
307
308 UTF support has been enhanced.
309
310 (UTF mode can be used to display the excluded control characters - display
311 UTF character 0xF0cc, where cc is the hex code of the position in the ROM
312 character set to display.)
313
314 A new set of Nonstandard Sequences is defined, prefixed by ESC ].  (setterm
315 commands are still CSI ].)
316
317 Colour palette support is added.
318
319 512 byte font support is added.
320
321 Font height support allows the screen to resize to fit the font.
322
323 Nonstandard Sequences
324 - ---------------------
325 ^[]P    Set palette
326         Seven parameters are collected
327         par1 is the palette element to redefine
328         par2, par3 set the red component
329         par4, par5 set the green component
330         par6, par7 set the blue component
331 ^[]R    Resets the default palette
332
333
334 - --
335 Send comp.os.linux.announce submissions to: linux-announce@news.ornl.gov
336 PLEASE remember a short description of the software.
337
338 -----BEGIN PGP SIGNATURE-----
339 Version: 2.6.2i
340
341 iQCVAwUBMG1wkYQRll5MupLRAQHZRgP+IdvvxOk6svo5Gum8wY31vtyILGYuadRU
342 rj84hrUAgvKZG3iaz+MOikx5PIcbxXA4LlfpPLkq9EfyT9sDJfEPYI8w+9I8bbvB
343 a0G1vpDCG8WbC+G3vwVMK0fnySFjhru4JaXHCTeagUzGLXVFqD4JhWbuXkhQH08f
344 9jt/ZgNgaB4=
345 =m2ca
346 -----END PGP SIGNATURE-----
347
348 Path: cwi.nl!sun4nl!EU.net!news.sprintlink.net!tank.news.pipex.net!pipex!dispatch.news.demon.net!demon!mail2news.demon.co.uk!drealm.demon.co.uk
349 From: Peter Jones <thanatos@drealm.org>
350 Newsgroups: comp.os.linux.misc
351 Subject: Re: Linux Console Terminal Documentation
352 Date: 30 Sep 1995 20:12:27 +0100
353 Organization: drealm conference system +44 (0)181 568 2204
354 Lines: 35
355 Message-ID: <44k4qr$6aj@drealm.drealm.org>
356 References: <cola-liw-812479025-13056-1@oravannahka.helsinki.fi>
357 X-NNTP-Posting-Host: drealm.demon.co.uk
358 X-Newsreader: TIN [version 1.2 PL2]
359
360 I (thanatos@drealm.org) wrote, in col-announce:
361 [chop chop]
362 : Nonstandard Sequences
363 : - ---------------------
364 : ^[]P  Set palette
365 :       Seven parameters are collected
366 :       par1 is the palette element to redefine
367 :       par2, par3 set the red component
368 :       par4, par5 set the green component
369 :       par6, par7 set the blue component
370 : ^[]R  Resets the default palette
371
372
373 This should read (i.e. it makes sense...) like this:
374
375 Nonstandard Sequences
376 ---------------------
377 ^[]P    Set palette
378         Seven hex digits should follow (0-9, a-f, A-F):
379         1 is the palette element to redefine
380         2*16 + 3 set the red component
381         4*16 + 5 set the green component
382         6*16 + 7 set the blue component
383 ^[]R    Resets the default palette
384
385
386 Hope that helps...
387
388 (One day my "other" linux box (crash-n-burn...) will have colour...)
389
390 -- Peter
391 -- 
392 Drealm Conference System -- (+44) 181 568 2204 (V.FC)
393 The home of drealmBBS -------- six lines -- live chat
394