OSDN Git Service

(split) LDP_man-pages: update original to v3.34.
[linuxjm/LDP_man-pages.git] / original / man4 / console_codes.4
1 '\" t
2 .\" Copyright (c) 1996 Andries Brouwer <aeb@cwi.nl>, Mon Oct 31 22:13:04 1996
3 .\"
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" This is combined from many sources.
10 .\" For Linux, the definitive source is of course console.c.
11 .\" About vt100-like escape sequences in general there are
12 .\" the ISO 6429 and ISO 2022 norms, the descriptions of
13 .\" an actual vt100, and the xterm docs (ctlseqs.ms).
14 .\" Substantial portions of this text are derived from a write-up
15 .\" by Eric S. Raymond <esr@thyrsus.com>.
16 .\"
17 .\" Tiny correction, aeb, 961107.
18 .\"
19 .\" 2006-05-27, Several corrections - Thomas E. Dickey
20 .\"
21 .TH CONSOLE_CODES 4 2011-09-15 "Linux" "Linux Programmer's Manual"
22 .SH NAME
23 console_codes \- Linux console escape and control sequences
24 .SH DESCRIPTION
25 The Linux console implements a large subset of the VT102 and ECMA-48/ISO
26 6429/ANSI X3.64 terminal controls, plus certain private-mode sequences
27 for changing the color palette, character-set mapping, etc.
28 In the tabular descriptions below, the second column gives ECMA-48 or DEC
29 mnemonics (the latter if prefixed with DEC) for the given function.
30 Sequences without a mnemonic are neither ECMA-48 nor VT102.
31 .LP
32 After all the normal output processing has been done, and a
33 stream of characters arrives at the console driver for actual
34 printing, the first thing that happens is a translation from
35 the code used for processing to the code used for printing.
36 .LP
37 If the console is in UTF-8 mode, then the incoming bytes are
38 first assembled into 16-bit Unicode codes.
39 Otherwise each byte is transformed according to the current mapping table
40 (which translates it to a Unicode value).
41 See the \fBCharacter Sets\fP section below for discussion.
42 .LP
43 In the normal case, the Unicode value is converted to a font index,
44 and this is stored in video memory, so that the corresponding glyph
45 (as found in video ROM) appears on the screen.
46 Note that the use of Unicode (and the design of the PC hardware)
47 allows us to use 512 different glyphs simultaneously.
48 .LP
49 If the current Unicode value is a control character, or we are
50 currently processing an escape sequence, the value will treated
51 specially.
52 Instead of being turned into a font index and rendered as
53 a glyph, it may trigger cursor movement or other control functions.
54 See the \fBLinux Console Controls\fP section below for discussion.
55 .LP
56 It is generally not good practice to hard-wire terminal controls into
57 programs.
58 Linux supports a
59 .BR terminfo (5)
60 database of terminal capabilities.
61 Rather than emitting console escape sequences by hand, you will almost
62 always want to use a terminfo-aware screen library or utility such as
63 .BR ncurses (3),
64 .BR tput (1),
65 or
66 .BR reset (1).
67 .SS "Linux Console Controls"
68 This section describes all the control characters and escape sequences
69 that invoke special functions (i.e., anything other than writing a
70 glyph at the current cursor location) on the Linux console.
71 .PP
72 .B "Control characters"
73 .sp
74 A character is a control character if (before transformation
75 according to the mapping table) it has one of the 14 codes
76 00 (NUL), 07 (BEL), 08 (BS), 09 (HT), 0a (LF), 0b (VT),
77 0c (FF), 0d (CR), 0e (SO), 0f (SI), 18 (CAN), 1a (SUB),
78 1b (ESC), 7f (DEL).
79 One can set a "display control characters" mode (see below),
80 and allow 07, 09, 0b, 18, 1a, 7f to be displayed as glyphs.
81 On the other hand, in UTF-8 mode all codes 00-1f are regarded
82 as control characters, regardless of any "display control characters"
83 mode.
84 .PP
85 If we have a control character, it is acted upon immediately
86 and then discarded (even in the middle of an escape sequence)
87 and the escape sequence continues with the next character.
88 (However, ESC starts a new escape sequence, possibly aborting a previous
89 unfinished one, and CAN and SUB abort any escape sequence.)
90 The recognized control characters are BEL, BS, HT, LF, VT, FF,
91 CR, SO, SI, CAN, SUB, ESC, DEL, CSI.
92 They do what one would expect:
93 .HP
94 BEL (0x07, \fB^G\fP) beeps;
95 .HP
96 BS (0x08, \fB^H\fP) backspaces one column
97 (but not past the beginning of the line);
98 .HP
99 HT (0x09, \fB^I\fP) goes to the next tab stop or to the end of the line
100 if there is no earlier tab stop;
101 .HP
102 LF (0x0A, \fB^J\fP), VT (0x0B, \fB^K\fP) and
103 FF (0x0C, \fB^L\fP) all give a linefeed,
104 and if LF/NL (new-line mode) is set also a carriage return;
105 .HP
106 CR (0x0D, \fB^M\fP) gives a carriage return;
107 .HP
108 SO (0x0E, \fB^N\fP) activates the G1 character set;
109 .HP
110 SI (0x0F, \fB^O\fP) activates the G0 character set;
111 .HP
112 CAN (0x18, \fB^X\fP) and SUB (0x1A, \fB^Z\fP) interrupt escape sequences;
113 .HP
114 ESC (0x1B, \fB^[\fP) starts an escape sequence;
115 .HP
116 DEL (0x7F) is ignored;
117 .HP
118 CSI (0x9B) is equivalent to ESC [.
119 .PP
120 .B "ESC- but not CSI-sequences"
121 .TS
122 l l l.
123 ESC c   RIS     Reset.
124 ESC D   IND     Linefeed.
125 ESC E   NEL     Newline.
126 ESC H   HTS     Set tab stop at current column.
127 ESC M   RI      Reverse linefeed.
128 ESC Z   DECID   T{
129 DEC private identification. The kernel
130 returns the string  ESC [ ? 6 c, claiming
131 that it is a VT102.
132 T}
133 ESC 7   DECSC   T{
134 Save current state (cursor coordinates,
135 attributes, character sets pointed at by G0, G1).
136 T}
137 ESC 8   DECRC   Restore state most recently saved by ESC 7.
138 ESC [   CSI     Control sequence introducer
139 ESC %           Start sequence selecting character set
140 ESC % @         \0\0\0Select default (ISO 646 / ISO 8859-1)
141 ESC % G         \0\0\0Select UTF-8
142 ESC % 8         \0\0\0Select UTF-8 (obsolete)
143 ESC # 8 DECALN  DEC screen alignment test \- fill screen with E's.
144 ESC (           Start sequence defining G0 character set
145 ESC ( B         \0\0\0Select default (ISO 8859-1 mapping)
146 ESC ( 0         \0\0\0Select VT100 graphics mapping
147 ESC ( U         \0\0\0Select null mapping \- straight to character ROM
148 ESC ( K         \0\0\0Select user mapping \- the map that is loaded by
149                 \0\0\0the utility \fBmapscrn\fP(8).
150 ESC )           Start sequence defining G1
151                 (followed by one of B, 0, U, K, as above).
152 ESC >   DECPNM  Set numeric keypad mode
153 ESC =   DECPAM  Set application keypad mode
154 ESC ]   OSC     T{
155 (Should be: Operating system command)
156 ESC ] P \fInrrggbb\fP: set palette, with parameter
157 given in 7 hexadecimal digits after the final P :-(.
158 Here \fIn\fP is the color (0-15), and \fIrrggbb\fP indicates
159 the red/green/blue values (0-255).
160 ESC ] R: reset palette
161 T}
162 .TE
163 .PP
164 .B "ECMA-48 CSI sequences"
165 .sp
166 CSI (or ESC [) is followed by a sequence of parameters,
167 at most NPAR (16), that are decimal numbers separated by
168 semicolons.
169 An empty or absent parameter is taken to be 0.
170 The sequence of parameters may be preceded by a single question mark.
171 .PP
172 However, after CSI [ (or ESC [ [) a single character is read
173 and this entire sequence is ignored.
174 (The idea is to ignore an echoed function key.)
175 .PP
176 The action of a CSI sequence is determined by its final character.
177 .TS
178 l l l l.
179 @       ICH     Insert the indicated # of blank characters.
180 A       CUU     Move cursor up the indicated # of rows.
181 B       CUD     Move cursor down the indicated # of rows.
182 C       CUF     Move cursor right the indicated # of columns.
183 D       CUB     Move cursor left the indicated # of columns.
184 E       CNL     Move cursor down the indicated # of rows, to column 1.
185 F       CPL     Move cursor up the indicated # of rows, to column 1.
186 G       CHA     Move cursor to indicated column in current row.
187 H       CUP     Move cursor to the indicated row, column (origin at 1,1).
188 J       ED      Erase display (default: from cursor to end of display).
189                 ESC [ 1 J: erase from start to cursor.
190                 ESC [ 2 J: erase whole display.
191                 ESC [ 3 J: erase whole display including scroll-back
192                            buffer (since Linux 3.0).
193 .\" ESC [ 3 J: commit f8df13e0a901fe55631fed66562369b4dba40f8b
194 K       EL      Erase line (default: from cursor to end of line).
195                 ESC [ 1 K: erase from start of line to cursor.
196                 ESC [ 2 K: erase whole line.
197 L       IL      Insert the indicated # of blank lines.
198 M       DL      Delete the indicated # of lines.
199 P       DCH     Delete the indicated # of characters on the current line.
200 X       ECH     Erase the indicated # of characters on the current line.
201 a       HPR     Move cursor right the indicated # of columns.
202 c       DA      Answer ESC [ ? 6 c: "I am a VT102".
203 d       VPA     Move cursor to the indicated row, current column.
204 e       VPR     Move cursor down the indicated # of rows.
205 f       HVP     Move cursor to the indicated row, column.
206 g       TBC     Without parameter: clear tab stop at the current position.
207                 ESC [ 3 g: delete all tab stops.
208 h       SM      Set Mode (see below).
209 l       RM      Reset Mode (see below).
210 m       SGR     Set attributes (see below).
211 n       DSR     Status report (see below).
212 q       DECLL   Set keyboard LEDs.
213                 ESC [ 0 q: clear all LEDs
214                 ESC [ 1 q: set Scroll Lock LED
215                 ESC [ 2 q: set Num Lock LED
216                 ESC [ 3 q: set Caps Lock LED
217 r       DECSTBM Set scrolling region; parameters are top and bottom row.
218 s       ?       Save cursor location.
219 u       ?       Restore cursor location.
220 \`      HPA     Move cursor to indicated column in current row.
221 .TE
222 .PP
223 .B ECMA-48 Set Graphics Rendition
224 .sp
225 The ECMA-48 SGR sequence ESC [ \fIparameters\fP m sets display
226 attributes.
227 Several attributes can be set in the same sequence, separated by
228 semicolons.
229 An empty parameter (between semicolons or string initiator or
230 terminator) is interpreted as a zero.
231 .TS
232 l l.
233 param   result
234 0       reset all attributes to their defaults
235 1       set bold
236 2       set half-bright (simulated with color on a color display)
237 4       T{
238 set underscore (simulated with color on a color display)
239 (the colors used to simulate dim or underline are set
240 using ESC ] ...)
241 T}
242 5       set blink
243 7       set reverse video
244 10      T{
245 reset selected mapping, display control flag,
246 and toggle meta flag (ECMA-48 says "primary font").
247 T}
248 11      T{
249 select null mapping, set display control flag,
250 reset toggle meta flag (ECMA-48 says "first alternate font").
251 T}
252 12      T{
253 select null mapping, set display control flag,
254 set toggle meta flag (ECMA-48 says "second alternate font").
255 The toggle meta flag
256 causes the high bit of a byte to be toggled
257 before the mapping table translation is done.
258 T}
259 21      set normal intensity (ECMA-48 says "doubly underlined")
260 22      set normal intensity
261 24      underline off
262 25      blink off
263 27      reverse video off
264 30      set black foreground
265 31      set red foreground
266 32      set green foreground
267 33      set brown foreground
268 34      set blue foreground
269 35      set magenta foreground
270 36      set cyan foreground
271 37      set white foreground
272 38      set underscore on, set default foreground color
273 39      set underscore off, set default foreground color
274 40      set black background
275 41      set red background
276 42      set green background
277 43      set brown background
278 44      set blue background
279 45      set magenta background
280 46      set cyan background
281 47      set white background
282 49      set default background color
283 .TE
284 .PP
285 .B ECMA-48 Mode Switches
286 .TP
287 ESC [ 3 h
288 DECCRM (default off): Display control chars.
289 .TP
290 ESC [ 4 h
291 DECIM (default off): Set insert mode.
292 .TP
293 ESC [ 20 h
294 LF/NL (default off): Automatically follow echo of LF, VT or FF with CR.
295 .\"
296 .PP
297 .B ECMA-48 Status Report Commands
298 .\"
299 .TP
300 ESC [ 5 n
301 Device status report (DSR): Answer is ESC [ 0 n (Terminal OK).
302 .TP
303 ESC [ 6 n
304 Cursor position report (CPR): Answer is ESC [ \fIy\fP ; \fIx\fP R,
305 where \fIx,y\fP is the cursor location.
306 .\"
307 .PP
308 .B DEC Private Mode (DECSET/DECRST) sequences
309 .sp
310 .\"
311 These are not described in ECMA-48.
312 We list the Set Mode sequences;
313 the Reset Mode sequences are obtained by replacing the final \(aqh\(aq
314 by \(aql\(aq.
315 .TP
316 ESC [ ? 1 h
317 DECCKM (default off): When set, the cursor keys send an ESC O prefix,
318 rather than ESC [.
319 .TP
320 ESC [ ? 3 h
321 DECCOLM (default off = 80 columns): 80/132 col mode switch.
322 The driver sources note that this alone does not suffice; some user-mode
323 utility such as
324 .BR resizecons (8)
325 has to change the hardware registers on the console video card.
326 .TP
327 ESC [ ? 5 h
328 DECSCNM (default off): Set reverse-video mode.
329 .TP
330 ESC [ ? 6 h
331 DECOM (default off): When set, cursor addressing is relative to
332 the upper left corner of the scrolling region.
333 .TP
334 ESC [ ? 7 h
335 DECAWM (default on): Set autowrap on.
336 In this mode, a graphic
337 character emitted after column 80 (or column 132 of DECCOLM is on)
338 forces a wrap to the beginning of the following line first.
339 .TP
340 ESC [ ? 8 h
341 DECARM (default on): Set keyboard autorepeat on.
342 .TP
343 ESC [ ? 9 h
344 X10 Mouse Reporting (default off): Set reporting mode to 1 (or reset to
345 0) \(em see below.
346 .TP
347 ESC [ ? 25 h
348 DECTECM (default on): Make cursor visible.
349 .TP
350 ESC [ ? 1000 h
351 X11 Mouse Reporting (default off): Set reporting mode to 2 (or reset
352 to 0) \(em see below.
353 .\"
354 .PP
355 .B Linux Console Private CSI Sequences
356 .sp
357 .\"
358 The following sequences are neither ECMA-48 nor native VT102.
359 They are native to the Linux console driver.
360 Colors are in SGR parameters:
361 0 = black, 1 = red, 2 = green, 3 = brown, 4 = blue, 5 = magenta, 6 =
362 cyan, 7 = white.
363 .TS
364 l l.
365 ESC [ 1 ; \fIn\fP ]     Set color \fIn\fP as the underline color
366 ESC [ 2 ; \fIn\fP ]     Set color \fIn\fP as the dim color
367 ESC [ 8 ]               Make the current color pair the default attributes.
368 ESC [ 9 ; \fIn\fP ]     Set screen blank timeout to \fIn\fP minutes.
369 ESC [ 10 ; \fIn\fP ]    Set bell frequency in Hz.
370 ESC [ 11 ; \fIn\fP ]    Set bell duration in msec.
371 ESC [ 12 ; \fIn\fP ]    Bring specified console to the front.
372 ESC [ 13 ]              Unblank the screen.
373 ESC [ 14 ; \fIn\fP ]    Set the VESA powerdown interval in minutes.
374 .TE
375 .SS "Character Sets"
376 The kernel knows about 4 translations of bytes into console-screen
377 symbols.
378 The four tables are: a) Latin1 \-> PC,
379 b) VT100 graphics \-> PC, c) PC \-> PC, d) user-defined.
380 .PP
381 There are two character sets, called G0 and G1, and one of them
382 is the current character set.
383 (Initially G0.)
384 Typing \fB^N\fP causes G1 to become current,
385 \fB^O\fP causes G0 to become current.
386 .PP
387 These variables G0 and G1 point at a translation table, and can be
388 changed by the user.
389 Initially they point at tables a) and b), respectively.
390 The sequences ESC ( B and ESC ( 0 and ESC ( U and ESC ( K cause G0 to
391 point at translation table a), b), c) and d), respectively.
392 The sequences ESC ) B and ESC ) 0 and ESC ) U and ESC ) K cause G1 to
393 point at translation table a), b), c) and d), respectively.
394 .PP
395 The sequence ESC c causes a terminal reset, which is what you want if the
396 screen is all garbled.
397 The oft-advised "echo ^V^O" will only make G0 current,
398 but there is no guarantee that G0 points at table a).
399 In some distributions there is a program
400 .BR reset (1)
401 that just does "echo ^[c".
402 If your terminfo entry for the console is correct
403 (and has an entry rs1=\\Ec), then "tput reset" will also work.
404 .PP
405 The user-defined mapping table can be set using
406 .BR mapscrn (8).
407 The result of the mapping is that if a symbol c is printed, the symbol
408 s = map[c] is sent to the video memory.
409 The bitmap that corresponds to
410 s is found in the character ROM, and can be changed using
411 .BR setfont (8).
412 .SS "Mouse Tracking"
413 The mouse tracking facility is intended to return
414 .BR xterm (1)-compatible
415 mouse status reports.
416 Because the console driver has no way to know
417 the device or type of the mouse, these reports are returned in the
418 console input stream only when the virtual terminal driver receives
419 a mouse update ioctl.
420 These ioctls must be generated by a mouse-aware
421 user-mode application such as the
422 .BR gpm (8)
423 daemon.
424 .PP
425 The mouse tracking escape sequences generated by
426 \fBxterm\fP(1) encode numeric parameters in a single character as
427 \fIvalue\fP+040.
428 For example, \(aq!\(aq is 1.
429 The screen coordinate system is 1-based.
430 .PP
431 The X10 compatibility mode sends an escape sequence on button press
432 encoding the location and the mouse button pressed.
433 It is enabled by sending ESC [ ? 9 h and disabled with ESC [ ? 9 l.
434 On button press, \fBxterm\fP(1) sends
435 ESC [ M \fIbxy\fP (6 characters).
436 Here \fIb\fP is button\-1,
437 and \fIx\fP and \fIy\fP are the x and y coordinates of the mouse
438 when the button was pressed.
439 This is the same code the kernel also produces.
440 .PP
441 Normal tracking mode (not implemented in Linux 2.0.24) sends an escape
442 sequence on both button press and release.
443 Modifier information is also sent.
444 It is enabled by sending ESC [ ? 1000 h and disabled with
445 ESC [ ? 1000 l.
446 On button press or release, \fBxterm\fP(1) sends ESC [ M
447 \fIbxy\fP.
448 The low two bits of \fIb\fP encode button information:
449 0=MB1 pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release.
450 The upper bits encode what modifiers were down when the button was
451 pressed and are added together: 4=Shift, 8=Meta, 16=Control.
452 Again \fIx\fP and
453 \fIy\fP are the x and y coordinates of the mouse event.
454 The upper left corner is (1,1).
455 .SS "Comparisons With Other Terminals"
456 Many different terminal types are described, like the Linux console,
457 as being "VT100-compatible".
458 Here we discuss differences between the
459 Linux console and the two most important others, the DEC VT102 and
460 .BR xterm (1).
461 .\"
462 .PP
463 .B Control-character handling
464 .sp
465 The VT102 also recognized the following control characters:
466 .HP
467 NUL (0x00) was ignored;
468 .HP
469 ENQ (0x05) triggered an answerback message;
470 .HP
471 DC1 (0x11, \fB^Q\fP, XON) resumed transmission;
472 .HP
473 DC3 (0x13, \fB^S\fP, XOFF) caused VT100 to ignore (and stop transmitting)
474 all codes except XOFF and XON.
475 .LP
476 VT100-like DC1/DC3 processing may be enabled by the tty driver.
477 .LP
478 The
479 .BR xterm (1)
480 program (in VT100 mode) recognizes the control characters
481 BEL, BS, HT, LF, VT, FF, CR, SO, SI, ESC.
482 .\"
483 .PP
484 .B Escape sequences
485 .sp
486 VT100 console sequences not implemented on the Linux console:
487 .TS
488 l l l.
489 ESC N   SS2     Single shift 2. (Select G2 character set for the next
490                 character only.)
491 ESC O   SS3     Single shift 3. (Select G3 character set for the next
492                 character only.)
493 ESC P   DCS     Device control string (ended by ESC \\)
494 ESC X   SOS     Start of string.
495 ESC ^   PM      Privacy message (ended by ESC \\)
496 ESC \\  ST      String terminator
497 ESC * ...               Designate G2 character set
498 ESC + ...               Designate G3 character set
499 .TE
500 .PP
501 The program
502 .BR xterm (1)
503 (in VT100 mode) recognizes ESC c, ESC # 8, ESC >, ESC =,
504 ESC D, ESC E, ESC H, ESC M, ESC N, ESC O, ESC P ... ESC \\,
505 ESC Z (it answers ESC [ ? 1 ; 2 c, "I am a VT100 with
506 advanced video option")
507 and ESC ^ ... ESC \\ with the same meanings as indicated above.
508 It accepts ESC (, ESC ), ESC *,  ESC + followed by 0, A, B for
509 the DEC special character and line drawing set, UK, and US-ASCII,
510 respectively.
511 .PP
512 The user can configure \fBxterm\fP(1) to respond to VT220-specific
513 control sequences, and it will identify itself as a VT52, VT100, and
514 up depending on the way it is configured and initialized.
515 .PP
516 It accepts ESC ] (OSC) for the setting of certain resources.
517 In addition to the ECMA-48 string terminator (ST),
518 \fBxterm\fP(1) accepts a BEL to terminate an OSC string.
519 These are a few of the OSC control sequences recognized by \fBxterm\fP(1):
520 .TS
521 l l.
522 ESC ] 0 ; \fItxt\fP ST  Set icon name and window title to \fItxt\fP.
523 ESC ] 1 ; \fItxt\fP ST  Set icon name to \fItxt\fP.
524 ESC ] 2 ; \fItxt\fP ST  Set window title to \fItxt\fP.
525 ESC ] 4 ; \fInum\fP; \fItxt\fP ST       Set ANSI color \fInum\fP to \fItxt\fP.
526 ESC ] 10 ; \fItxt\fP ST Set dynamic text color to \fItxt\fP.
527 ESC ] 4 6 ; \fIname\fP ST       Change log file to \fIname\fP (normally disabled
528         by a compile-time option)
529 ESC ] 5 0 ; \fIfn\fP ST Set font to \fIfn\fP.
530 .TE
531 .PP
532 It recognizes the following with slightly modified meaning
533 (saving more state, behaving closer to VT100/VT220):
534 .TS
535 l l l.
536 ESC 7  DECSC    Save cursor
537 ESC 8  DECRC    Restore cursor
538 .TE
539 .PP
540 It also recognizes
541 .TS
542 l l l.
543 ESC F           Cursor to lower left corner of screen (if enabled by
544                 \fBxterm\fP(1)'s \fBhpLowerleftBugCompat\fP resource)
545 ESC l           Memory lock (per HP terminals).
546                 Locks memory above the cursor.
547 ESC m           Memory unlock (per HP terminals).
548 ESC n   LS2     Invoke the G2 character set.
549 ESC o   LS3     Invoke the G3 character set.
550 ESC |   LS3R    Invoke the G3 character set as GR.
551 ESC }   LS2R    Invoke the G2 character set as GR.
552 ESC ~   LS1R    Invoke the G1 character set as GR.
553 .TE
554 .PP
555 It also recognizes ESC % and provides a more complete UTF-8
556 implementation than Linux console.
557 .\"
558 .PP
559 .B CSI Sequences
560 .sp
561 Old versions of \fBxterm\fP(1), for example, from X11R5,
562 interpret the blink SGR as a bold SGR.
563 Later versions which implemented ANSI colors, for example,
564 XFree86 3.1.2A in 1995, improved this by allowing
565 the blink attribute to be displayed as a color.
566 Modern versions of xterm implement blink SGR as blinking text
567 and still allow colored text as an alternate rendering of SGRs.
568 Stock X11R6 versions did not recognize the color-setting SGRs until
569 the X11R6.8 release, which incorporated XFree86 xterm.
570 All ECMA-48 CSI sequences recognized by Linux are also recognized by
571 .IR xterm ,
572 however \fBxterm\fP(1) implements several ECMA-48 and DEC control sequences
573 not recognized by Linux.
574 .PP
575 The \fBxterm\fP(1)
576 program recognizes all of the DEC Private Mode sequences listed
577 above, but none of the Linux private-mode sequences.
578 For discussion of \fBxterm\fP(1)'s
579 own private-mode sequences, refer to the
580 \fIXterm Control Sequences\fP
581 document by
582 Edward Moy,
583 Stephen Gildea,
584 and Thomas E. Dickey
585 available with the X distribution.
586 That document, though terse, is much longer than this manual page.
587 For a chronological overview,
588 .PP
589 .in +4n
590 http://invisible-island.net/xterm/xterm.log.html
591 .in
592 .PP
593 details changes to xterm.
594 .PP
595 The \fIvttest\fP program
596 .PP
597 .in +4n
598 http://invisible-island.net/vttest/
599 .in
600 .PP
601 demonstrates many of these control sequences.
602 The \fBxterm\fP(1) source distribution also contains sample
603 scripts which exercise other features.
604 .SH NOTES
605 ESC 8 (DECRC) is not able to restore the character set changed with
606 ESC %.
607 .SH BUGS
608 In 2.0.23, CSI is broken, and NUL is not ignored inside
609 escape sequences.
610 .PP
611 Some older kernel versions (after 2.0) interpret 8-bit control
612 sequences.
613 These "C1 controls" use codes between 128 and 159 to replace
614 ESC [, ESC ] and similar two-byte control sequence initiators.
615 There are fragments of that in modern kernels (either overlooked or
616 broken by changes to support UTF-8),
617 but the implementation is incomplete and should be regarded
618 as unreliable.
619 .PP
620 Linux "private mode" sequences do not follow the rules in ECMA-48
621 for private mode control sequences.
622 In particular, those ending with ] do not use a standard terminating
623 character.
624 The OSC (set palette) sequence is a greater problem,
625 since \fBxterm\fP(1) may interpret this as a control sequence
626 which requires a string terminator (ST).
627 Unlike the \fBsetterm\fP(1) sequences which will be ignored (since
628 they are invalid control sequences), the palette sequence will make
629 \fBxterm\fP(1) appear to hang (though pressing the return-key
630 will fix that).
631 To accommodate applications which have been hardcoded to use Linux
632 control sequences,
633 set the \fBxterm\fP(1) resource \fBbrokenLinuxOSC\fP to true.
634 .PP
635 An older version of this document implied that Linux recognizes the
636 ECMA-48 control sequence for invisible text.
637 It is ignored.
638 .SH "SEE ALSO"
639 .BR console (4),
640 .BR console_ioctl (4),
641 .BR charsets (7)