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
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
13 Content-Type: text/plain; charset=ISO-8859-1
14 Content-Transfer-Encoding: 8bit
16 -----BEGIN PGP SIGNED MESSAGE-----
18 I thought I'd do "something" for the Linux community (apart from
19 co-authoring drealmBBS :-)).
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.
30 (Everything you ever wanted to know but couldn't be bothered to look in the
33 Author: Peter L Jones <thanatos@drealm.org>
34 ~Date: Wed Sep 27 19:12:25 BST 1995
41 I don't use UTF. I've only covered it to the extent I can fathom from the
44 I've not documented "hardware scrollback".
46 In UTF mode, once a complete character is assembled, it is translated.
48 Otherwise, the character then has its top bit set if requested and is then
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
56 Otherwise, it might be a control character.
57 Otherwise it's ignored.
62 These are characters that make a mark on the display.
64 You can never display the glyph for char(27) by transmitting ESC.
66 You cannot display glyphs for any character in the Control Characters table,
69 If there is a "pending newline"
70 a crlf sequence is issued prior to the glyph.
72 If we're in "insert mode",
73 the rest of the line is shifted right; the character in the
76 The glyph is then displayed.
78 If the cursor is in the last column,
79 If automatic margins are turned on,
80 the "pending newline" state is set
82 the next glyph can overwrite this one.
83 Otherwise the cursor is advanced.
88 Control characters can occur during ESCape sequence processing.
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
99 ^o charset 0, translate table G0, don't display control
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 --}
106 ^x ^z cancel any ESCape sequence in progress
107 ^[ begin an ESCape sequence
108 ^? "delete" - ignored
109 128+^[ begin a CSI sequence
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
120 ^[M ri - cursor up, reverse scroll if top of scrolling region
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)
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.
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.
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. --}
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
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)
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
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.
199 3 Monitor (display control characters)
204 1 Cursor keys as application keys (send ^[Ox as appl, ^[[x as normal)
205 3 80 (off) or 132 (on) columns
207 6 Origin mode (and go to origin)
208 7 Autowrap (right margin)
212 1000 Mouse reports #2
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 --}
221 0 default (intensity normal, underline off, blink off, normal video,
222 default colours (which start as white on black))
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
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
246 Setterm Commmand Sequences
247 - --------------------------
248 The command is in par1, followed by parameters.
250 1 Set underline colour - par2 is 0 to 15, which is 0 to 7 as above,
252 2 Set dim colour - par2 as above
253 8 Store current attributes as defaults (so that CSI 0 m restores to
255 9 Set blanking interval to par2 minutes (max one hour)
258 UTF Control Sequences
259 =====================
261 ^[%G ^[%8 Turn on UTF (^[%8 is deprecated)
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:
272 ^[(B ^[)B 0 Normal Map (default G0 map)
273 ^[(0 ^[)0 1 Graphics Map (default G1 map)
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
287 Only one test, ^[#8, is defined. This fills the display with the character
288 'E' to allow the display to be centred.
293 The console driver changed in 1.3.x. This documents the changes between
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).
299 Font support is enhanced.
301 In addition to ESC, some other control characters cannot have their glyphs
302 displayed - ^@ ^H ^J ^L ^M ^N ^O ^[.
304 Hardware scrollback has been enhanced.
306 The "Normal Map" has been renamed "Latin 1 Map" (LAT1_MAP).
308 UTF support has been enhanced.
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.)
314 A new set of Nonstandard Sequences is defined, prefixed by ESC ]. (setterm
315 commands are still CSI ].)
317 Colour palette support is added.
319 512 byte font support is added.
321 Font height support allows the screen to resize to fit the font.
323 Nonstandard Sequences
324 - ---------------------
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
335 Send comp.os.linux.announce submissions to: linux-announce@news.ornl.gov
336 PLEASE remember a short description of the software.
338 -----BEGIN PGP SIGNATURE-----
341 iQCVAwUBMG1wkYQRll5MupLRAQHZRgP+IdvvxOk6svo5Gum8wY31vtyILGYuadRU
342 rj84hrUAgvKZG3iaz+MOikx5PIcbxXA4LlfpPLkq9EfyT9sDJfEPYI8w+9I8bbvB
343 a0G1vpDCG8WbC+G3vwVMK0fnySFjhru4JaXHCTeagUzGLXVFqD4JhWbuXkhQH08f
346 -----END PGP SIGNATURE-----
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
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]
360 I (thanatos@drealm.org) wrote, in col-announce:
362 : Nonstandard Sequences
363 : - ---------------------
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
373 This should read (i.e. it makes sense...) like this:
375 Nonstandard Sequences
376 ---------------------
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
388 (One day my "other" linux box (crash-n-burn...) will have colour...)
392 Drealm Conference System -- (+44) 181 568 2204 (V.FC)
393 The home of drealmBBS -------- six lines -- live chat