Penguin
Annotated edit history of terminfo(5) version 3, including all changes. View license author blame.
Rev Author # Line
3 CraigBox 1 Man, is this one going to be a bitch to clean up.
2
1 perry 3 !!NAME
4
5 terminfo - terminal capability data base
3 CraigBox 6
1 perry 7 !!SYNOPSIS
8
9 /usr/share/terminfo/*/*
10
3 CraigBox 11 !!DESCRIPTION
1 perry 12
13 ''Terminfo'' is a data base describing terminals, used by
14 screen-oriented programs such as nvi(1),
3 CraigBox 15 [Rogue] and libraries such as __curses__(3X).
1 perry 16 ''Terminfo'' describes terminals by giving a set of
17 capabilities which they have, by specifying how to perform
18 screen operations, and by specifying padding requirements
19 and initialization sequences.
20
21
22 Entries in ''terminfo'' consist of a sequence of `,'
23 separated fields (embedded commas may be escaped with a
24 backslash or notated as 072). White space after the `,'
25 separator is ignored. The first entry for each terminal
26 gives the names which are known for the terminal, separated
27 by `|' characters. The first name given is the most common
28 abbreviation for the terminal, the last name given should be
29 a long name fully identifying the terminal, and all others
30 are understood as synonyms for the terminal name. All names
31 but the last should be in lower case and contain no blanks;
32 the last name may well contain upper case and blanks for
33 readability.
34
35
36 Terminal names (except for the last, verbose entry) should
37 be chosen using the following conventions. The particular
38 piece of hardware making up the terminal should have a root
39 name, thus ``hp2621''. This name should not contain hyphens.
40 Modes that the hardware can be in, or user preferences,
41 should be indicated by appending a hyphen and a mode suffix.
42 Thus, a vt100 in 132 column mode would be vt100-w. The
43 following suffixes should be used where
44 possible:
45
46
47 For more on terminal naming conventions, see the __term(7)__ manual page.
48
49
50 __Capabilities__
51
52
53 The following is a complete table of the capabilities
54 included in a terminfo description block and available to
55 terminfo-using code. In each line of the
56 table,
57
58
59 The __variable__ is the name by which the
60 programmer (at the terminfo level) accesses the
61 capability.
62
63
64 The __capname__ is the short name used in the text
65 of the database, and is used by a person updating the
66 database. Whenever possible, capnames are chosen to be the
67 same as or similar to the ANSI X3.64-1979 standard (now
68 superseded by ECMA-48, which uses identical or very similar
69 names). Semantics are also intended to match those of the
70 specification.
71
72
73 The termcap code is the old __termcap__
74 capability name (some capabilities are new, and have names
75 which termcap did not originate).
76
77
78 Capability names have no hard length limit, but an informal
79 limit of 5 characters has been adopted to keep them short
80 and to allow the tabs in the source file __Caps__ to line
81 up nicely.
82
83
84 Finally, the description field attempts to convey the
85 semantics of the capability. You may find some codes in the
86 description field:
87
88
89 (P)
90
91
92 indicates that padding may be specified
93
94
95 #[[1-9]
96
97
98 in the description field indicates that the string is passed
99 through tparm with parms as given (#''i'').
100
101
102 (P*)
103
104
105 indicates that padding may vary in proportion to the number
106 of lines affected
107
108
109 (#''i'')
110
111
112 indicates the ''i''th parameter.
113
114
115 These are the boolean capabilities:
116
117
118 These are the numeric capabilities:
119
120
121 The following numeric capabilities are present in the SVr4.0 term structure, but are not yet documented in the man page. They came in with SVr4's printer support.
122
123
124 These are the string capabilities:
125
126
127 The following string capabilities are present in the SVr4.0 term structure, but were originally not documented in the man page.
128
129
130 The XSI Curses standard added these. They are some post-4.1 versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x. The __ncurses__ termcap names for them are invented; according to the XSI Curses standard, they have no termcap names. If your compiled terminfo entries use these, they may not be binary-compatible with System V terminfo entries after SVr4.1; beware!
131
132
133 __A Sample Entry__
134
135
136 The following entry, describing an ANSI-standard terminal,
137 is representative of what a __terminfo__ entry for a
138 modern terminal typically looks like.
139
140
141 ansi|ansi/pc-term compatible with color,
142 mc5i,
143 colors#8, ncv#3, pairs#64,
144 cub=E[[%p1%dD, cud=E[[%p1%dB, cuf=E[[%p1%dC,
145 cuu=E[[%p1%dA, dch=E[[%p1%dP, dl=E[[%p1%dM,
146 ech=E[[%p1%dX, el1=E[[1K, hpa=E[[%p1%dG, ht=E[[I,
147 ich=E[[%p1%d@, il=E[[%p1%dL, indn=E[[%p1%dS, .indn=E[[%p1%dT,
148 kbs=^H, kcbt=E[[Z, kcub1=E[[D, kcud1=E[[B,
149 kcuf1=E[[C, kcuu1=E[[A, kf1=E[[M, kf10=E[[V,
150 kf11=E[[W, kf12=E[[X, kf2=E[[N, kf3=E[[O, kf4=E[[P,
151 kf5=E[[Q, kf6=E[[R, kf7=E[[S, kf8=E[[T, kf9=E[[U,
152 kich1=E[[L, mc4=E[[4i, mc5=E[[5i, nel=rE[[S,
153 op=E[[37;40m, rep=%p1%cE[[%p2%{1}%-%db,
154 rin=E[[%p1%dT, s0ds=E(B, s1ds=E)B, s2ds=E*B,
155 s3ds=E+B, setab=E[[4%p1%dm, setaf=E[[3%p1%dm,
156 setb=E[[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
157 setf=E[[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
158 sgr=E[[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p8%t;11%;%?%p9%t;12%;m,
159 sgr0=E[[0;10m, tbc=E[[2g, u6=E[[%d;%dR, u7=E[[6n,
160 u8=E[[?%[[;0123456789]c, u9=E[[c, vpa=E[[%p1%dd,
161 Entries may continue onto multiple lines by placing white space at the beginning of each line except the first. Comments may be included on lines beginning with ``#''. Capabilities in ''terminfo'' are of three types: Boolean capabilities which indicate that the terminal has some particular feature, numeric capabilities giving the size of the terminal or the size of particular delays, and string capabilities, which give a sequence which can be used to perform particular terminal operations.
162
163
164 __Types of Capabilities__
165
166
167 All capabilities have names. For instance, the fact that
168 ANSI-standard terminals have ''automatic margins'' (i.e.,
169 an automatic return and line-feed when the end of a line is
170 reached) is indicated by the capability __am__. Hence the
171 description of ansi includes __am__. Numeric capabilities
172 are followed by the character `#' and then a positive value.
173 Thus __cols__, which indicates the number of columns the
174 terminal has, gives the value `80' for ansi. Values for
175 numeric capabilities may be specified in decimal, octal or
176 hexadecimal, using the C programming language conventions
177 (e.g., 255, 0377 and 0xff or 0xFF).
178
179
180 Finally, string valued capabilities, such as __el__
181 (clear to end of line sequence) are given by the
182 two-character code, an `=', and then a string ending at the
183 next following `,'.
184
185
186 A number of escape sequences are provided in the string
187 valued capabilities for easy encoding of characters there.
188 Both __E__ and __e__ map to an ESCAPE
189 character, __^x__ maps to a control-x for any appropriate
190 x, and the sequences __n l r t b f s__ give a newline,
191 line-feed, return, tab, backspace, form-feed, and space.
192 Other escapes include __^__ for __^__, __\__ for
193 __\__, __\__, for comma, __:__ for __:__, and
194 __0__ for null. (__0__ will produce 200, which does
195 not terminate a string but behaves as a null character on
196 most terminals, providing CS7 is specified. See stty(1).)
197 Finally, characters may be given as three octal digits after
198 a __\__.
199
200
201 A delay in milliseconds may appear anywhere in a string
202 capability, enclosed in $
203 el__=EK$
204 __tputs'' to provide this delay. The delay must be a
205 number with at most one decimal place of precision; it may
206 be followed by suffixes `*' or '/' or both. A `*' indicates
207 that the padding required is proportional to the number of
208 lines affected by the operation, and the amount given is the
209 per-affected-unit padding required. (In the case of insert
210 character, the factor is still the number of ''lines''
211 affected.) Normally, padding is advisory if the device has
212 the __xon__ capability; it is used for cost computation
213 but does not trigger delays. A `/' suffix indicates that the
214 padding is mandatory and forces a delay of the given number
215 of milliseconds even on devices for which __xon__ is
216 present to indicate flow control.
217
218
219 Sometimes individual capabilities must be commented out. To
220 do this, put a period before the capability name. For
221 example, see the second __ind__ in the example
222 above.
223
224
225 __Fetching Compiled Descriptions__
226
227
228 If the environment variable TERMINFO is set, it is
229 interpreted as the pathname of a directory containing the
230 compiled description you are working on. Only that directory
231 is searched.
232
233
234 If TERMINFO is not set, the __ncurses__ version of the
235 terminfo reader code will instead look in the directory
236 __$HOME/.terminfo__ for a compiled description. If it
237 fails to find one there, and the environment variable
238 TERMINFO_DIRS is set, it will interpret the contents of that
239 variable as a list of colon- separated directories to be
240 searched (an empty entry is interpreted as a command to
241 search ''/usr/share/terminfo''). If no description is
242 found in any of the TERMINFO_DIRS directories, the fetch
243 fails.
244
245
246 If neither TERMINFO nor TERMINFO_DIRS is set, the last place
247 tried will be the system terminfo directory,
248 ''/usr/share/terminfo''.
249
250
251 (Neither the __$HOME/.terminfo__ lookups nor
252 TERMINFO_DIRS extensions are supported under stock System V
253 terminfo/curses.)
254
255
256 __Preparing Descriptions__
257
258
259 We now outline how to prepare descriptions of terminals. The
260 most effective way to prepare a terminal description is by
261 imitating the description of a similar terminal in
262 ''terminfo'' and to build up a description gradually,
263 using partial descriptions with ''vi'' or some other
264 screen-oriented program to check that they are correct. Be
265 aware that a very unusual terminal may expose deficiencies
266 in the ability of the ''terminfo'' file to describe it or
267 bugs in the screen-handling code of the test
268 program.
269
270
271 To get the padding for insert line right (if the terminal
272 manufacturer did not document it) a severe test is to edit a
273 large file at 9600 baud, delete 16 or so lines from the
274 middle of the screen, then hit the `u' key several times
275 quickly. If the terminal messes up, more padding is usually
276 needed. A similar test can be used for insert
277 character.
278
279
280 __Basic Capabilities__
281
282
283 The number of columns on each line for the terminal is given
284 by the __cols__ numeric capability. If the terminal is a
285 CRT , then the number of lines on the screen
286 is given by the __lines__ capability. If the terminal
287 wraps around to the beginning of the next line when it
288 reaches the right margin, then it should have the __am__
289 capability. If the terminal can clear its screen, leaving
290 the cursor in the home position, then this is given by the
291 __clear__ string capability. If the terminal overstrikes
292 (rather than clearing a position when a character is struck
293 over) then it should have the __os__ capability. If the
294 terminal is a printing terminal, with no soft copy unit,
295 give it both __hc__ and __os__. (__os__ applies to
296 storage scope terminals, such as TEKTRONIX
297 4010 series, as well as hard copy and APL terminals.) If
298 there is a code to move the cursor to the left edge of the
299 current row, give this as __cr__. (Normally this will be
300 carriage return, control M.) If there is a code to produce
301 an audible signal (bell, beep, etc) give this as
302 __bel__.
303
304
305 If there is a code to move the cursor one position to the
306 left (such as backspace) that capability should be given as
307 __cub1__. Similarly, codes to move to the right, up, and
308 down should be given as __cuf1__, __cuu1__, and
309 __cud1__. These local cursor motions should not alter the
310 text they pass over, for example, you would not normally use
311 `__cuf1__= ' because the space would erase the character
312 moved over.
313
314
315 A very important point here is that the local cursor motions
316 encoded in ''terminfo'' are undefined at the left and top
317 edges of a CRT terminal. Programs should
318 never attempt to backspace around the left edge, unless
319 __bw__ is given, and never attempt to go up locally off
320 the top. In order to scroll text up, a program will go to
321 the bottom left corner of the screen and send the __ind__
322 (index) string.
323
324
325 To scroll text down, a program goes to the top left corner
326 of the screen and sends the __ri__ (reverse index)
327 string. The strings __ind__ and __ri__ are undefined
328 when not on their respective corners of the
329 screen.
330
331
332 Parameterized versions of the scrolling sequences are
333 __indn__ and __rin__ which have the same semantics as
334 __ind__ and __ri__ except that they take one
335 parameter, and scroll that many lines. They are also
336 undefined except at the appropriate edge of the
337 screen.
338
339
340 The __am__ capability tells whether the cursor sticks at
341 the right edge of the screen when text is output, but this
342 does not necessarily apply to a __cuf1__ from the last
343 column. The only local motion which is defined from the left
344 edge is if __bw__ is given, then a __cub1__ from the
345 left edge will move to the right edge of the previous row.
346 If __bw__ is not given, the effect is undefined. This is
347 useful for drawing a box around the edge of the screen, for
348 example. If the terminal has switch selectable automatic
349 margins, the ''terminfo'' file usually assumes that this
350 is on; i.e., __am__. If the terminal has a command which
351 moves to the first column of the next line, that command can
352 be given as __nel__ (newline). It does not matter if the
353 command clears the remainder of the current line, so if the
354 terminal has no __cr__ and __lf__ it may still be
355 possible to craft a working __nel__ out of one or both of
356 them.
357
358
359 These capabilities suffice to describe hard-copy and
360 ``glass-tty'' terminals. Thus the model 33 teletype is
361 described as
362
363
364 33|tty33|tty|model 33 teletype,
365 bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,
366 while the Lear Siegler ADM-3 is described as
367
368
369 adm3|3|lsi adm3,
370 am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
371 ind=^J, lines#24,
372
373
374 __Parameterized Strings__
375
376
377 Cursor addressing and other strings requiring parameters in
378 the terminal are described by a parameterized string
379 capability, with ''printf''(3S) like escapes __%x__ in
380 it. For example, to address the cursor, the __cup__
381 capability is given, using two parameters: the row and
382 column to address to. (Rows and columns are numbered from
383 zero and refer to the physical screen visible to the user,
384 not to any unseen memory.) If the terminal has memory
385 relative cursor addressing, that can be indicated by
386 __mrcup__.
387
388
389 The parameter mechanism uses a stack and special __%__
390 codes to manipulate it. Typically a sequence will push one
391 of the parameters onto the stack and then print it in some
392 format. Often more complex operations are
393 necessary.
394
395
396 The __%__ encodings have the following
397 meanings:
398
399
400 %% outputs `%'
401 %''[[[['':'']flags][[width[[.precision]][[''doxXs'']
402 '' as in __printf__, flags are [[-+#] and space
403 %c print pop() like %c in printf()
404 %s print pop() like %s in printf()
405 %p[[1-9] push ''i'''th parm
406 %P[[a-z] set dynamic variable [[a-z] to pop()
407 %g[[a-z] get dynamic variable [[a-z] and push it
408 %P[[A-Z] set static variable [[a-z] to pop()
409 %g[[A-Z] get static variable [[a-z] and push it
410 %'''c''' char constant ''c
411 '' %{''nn''} integer constant ''nn
412 '' %l push strlen(pop)
413 %+ %- %* %/ %m
414 arithmetic (%m is mod): push(pop() op pop())
415 %
416 '' ci are conditions, bi are bodies.
417 Binary operations are in postfix form with the operands in the usual order. That is, to get x-5 one would use
418
419
420 Consider the HP2645, which, to get to row 3 and column 12,
421 needs to be sent E
422 cup__ capability is
423 ``cup=6E__
424
425
426 The Microterm ACT-IV needs the current row
427 and column sent preceded by a __^T__, with the row and
428 column simply encoded in binary, ``cup=^T%p1%c%p2%c''.
429 Terminals which use ``%c'' need to be able to backspace the
430 cursor (__cub1__), and to move the cursor up one line on
431 the screen (__cuu1__). This is necessary because it is
432 not always safe to transmit __n ^D__ and __r__, as the
433 system may change or discard them. (The library routines
434 dealing with terminfo set tty modes so that tabs are never
435 expanded, so t is safe to send. This turns out to be
436 essential for the Ann Arbor 4080.)
437
438
439 A final example is the LSI ADM -3a, which
440 uses row and column offset by a blank character, thus
441 ``cup=E=%p1%' '%+%c%p2%' '%+%c''. After sending `E=', this
442 pushes the first parameter, pushes the ASCII value for a
443 space (32), adds them (pushing the sum on the stack in place
444 of the two previous values) and outputs that value as a
445 character. Then the same is done for the second parameter.
446 More complex arithmetic is possible using the
447 stack.
448
449
450 __Cursor Motions__
451
452
453 If the terminal has a fast way to home the cursor (to very
454 upper left corner of screen) then this can be given as
455 __home__; similarly a fast way of getting to the lower
456 left-hand corner can be given as __ll__; this may involve
457 going up with __cuu1__ from the home position, but a
458 program should never do this itself (unless __ll__ does)
459 because it can make no assumption about the effect of moving
460 up from the home position. Note that the home position is
461 the same as addressing to (0,0): to the top left corner of
462 the screen, not of memory. (Thus, the EH sequence on HP
463 terminals cannot be used for __home__.)
464
465
466 If the terminal has row or column absolute cursor
467 addressing, these can be given as single parameter
468 capabilities __hpa__ (horizontal position absolute) and
469 __vpa__ (vertical position absolute). Sometimes these are
470 shorter than the more general two parameter sequence (as
471 with the hp2645) and can be used in preference to
472 __cup__. If there are parameterized local motions (e.g.,
473 move ''n'' spaces to the right) these can be given as
474 __cud__, __cub__, __cuf__, and __cuu__ with a
475 single parameter indicating how many spaces to move. These
476 are primarily useful if the terminal does not have
477 __cup__, such as the TEKTRONIX
478 4025.
479
480
481 If the terminal needs to be in a special mode when running a
482 program that uses these capabilities, the codes to enter and
483 exit this mode can be given as __smcup__ and
484 __rmcup__. This arises, for example, from terminals like
485 the Concept with more than one page of memory. If the
486 terminal has only memory relative cursor addressing and not
487 screen relative cursor addressing, a one screen-sized window
488 must be fixed into the terminal for cursor addressing to
489 work properly. This is also used for the
490 TEKTRONIX 4025, where __smcup__ sets the
491 command character to be the one used by terminfo. If the
492 __smcup__ sequence will not restore the screen after an
493 __rmcup__ sequence is output (to the state prior to
494 outputting __rmcup__), specify __nrrmc__.
495
496
497 __Area Clears__
498
499
500 If the terminal can clear from the current position to the
501 end of the line, leaving the cursor where it is, this should
502 be given as __el__. If the terminal can clear from the
503 beginning of the line to the current position inclusive,
504 leaving the cursor where it is, this should be given as
505 __el1__. If the terminal can clear from the current
506 position to the end of the display, then this should be
507 given as __ed__. __Ed__ is only defined from the first
508 column of a line. (Thus, it can be simulated by a request to
509 delete a large number of lines, if a true __ed__ is not
510 available.)
511
512
513 __Insert/delete line and vertical motions__
514
515
516 If the terminal can open a new blank line before the line
517 where the cursor is, this should be given as __il1__;
518 this is done only from the first position of a line. The
519 cursor must then appear on the newly blank line. If the
520 terminal can delete the line which the cursor is on, then
521 this should be given as __dl1__; this is done only from
522 the first position on the line to be deleted. Versions of
523 __il1__ and __dl1__ which take a single parameter and
524 insert or delete that many lines can be given as __il__
525 and __dl__.
526
527
528 If the terminal has a settable scrolling region (like the
529 vt100) the command to set this can be described with the
530 __csr__ capability, which takes two parameters: the top
531 and bottom lines of the scrolling region. The cursor
532 position is, alas, undefined after using this
533 command.
534
535
536 It is possible to get the effect of insert or delete line
537 using __csr__ on a properly chosen region; the __sc__
538 and __rc__ (save and restore cursor) commands may be
539 useful for ensuring that your synthesized insert/delete
540 string does not move the cursor. (Note that the
541 __ncurses__(3X) library does this synthesis
542 automatically, so you need not compose insert/delete strings
543 for an entry with __csr__).
544
545
546 Yet another way to construct insert and delete might be to
547 use a combination of index with the memory-lock feature
548 found on some terminals (like the HP-700/90 series, which
549 however also has insert/delete).
550
551
552 Inserting lines at the top or bottom of the screen can also
553 be done using __ri__ or __ind__ on many terminals
554 without a true insert/delete line, and is often faster even
555 on terminals with those features.
556
557
558 The boolean __non_dest_scroll_region__ should be set if
559 each scrolling window is effectively a view port on a
560 screen-sized canvas. To test for this capability, create a
561 scrolling region in the middle of the screen, write
562 something to the bottom line, move the cursor to the top of
563 the region, and do __ri__ followed by __dl1__ or
564 __ind__. If the data scrolled off the bottom of the
565 region by the __ri__ re-appears, then scrolling is
566 non-destructive. System V and XSI Curses expect that
567 __ind__, __ri__, __indn__, and __rin__ will
568 simulate destructive scrolling; their documentation cautions
569 you not to define __csr__ unless this is true. This
570 __curses__ implementation is more liberal and will do
571 explicit erases after scrolling if __ndstr__ is
572 defined.
573
574
575 If the terminal has the ability to define a window as part
576 of memory, which all commands affect, it should be given as
577 the parameterized string __wind__. The four parameters
578 are the starting and ending lines in memory and the starting
579 and ending columns in memory, in that order.
580
581
582 If the terminal can retain display memory above, then the
583 __da__ capability should be given; if display memory can
584 be retained below, then __db__ should be given. These
585 indicate that deleting a line or scrolling may bring
586 non-blank lines up from below or that scrolling back with
587 __ri__ may bring down non-blank lines.
588
589
590 __Insert/Delete Character__
591
592
593 There are two basic kinds of intelligent terminals with
594 respect to insert/delete character which can be described
595 using ''terminfo.'' The most common insert/delete
596 character operations affect only the characters on the
597 current line and shift characters off the end of the line
598 rigidly. Other terminals, such as the Concept 100 and the
599 Perkin Elmer Owl, make a distinction between typed and
600 untyped blanks on the screen, shifting upon an insert or
601 delete only to an untyped blank on the screen which is
602 either eliminated, or expanded to two untyped blanks. You
603 can determine the kind of terminal you have by clearing the
604 screen and then typing text separated by cursor motions.
605 Type ``abc def'' using local cursor motions (not spaces)
606 between the ``abc'' and the ``def''. Then position the
607 cursor before the ``abc'' and put the terminal in insert
608 mode. If typing characters causes the rest of the line to
609 shift rigidly and characters to fall off the end, then your
610 terminal does not distinguish between blanks and untyped
611 positions. If the ``abc'' shifts over to the ``def'' which
612 then move together around the end of the current line and
613 onto the next as you insert, you have the second type of
614 terminal, and should give the capability __in__, which
615 stands for ``insert null''. While these are two logically
616 separate attributes (one line versus multi-line insert mode,
617 and special treatment of untyped spaces) we have seen no
618 terminals whose insert mode cannot be described with the
619 single attribute.
620
621
622 Terminfo can describe both terminals which have an insert
623 mode, and terminals which send a simple sequence to open a
624 blank position on the current line. Give as __smir__ the
625 sequence to get into insert mode. Give as __rmir__ the
626 sequence to leave insert mode. Now give as __ich1__ any
627 sequence needed to be sent just before sending the character
628 to be inserted. Most terminals with a true insert mode will
629 not give __ich1__; terminals which send a sequence to
630 open a screen position should give it here.
631
632
633 If your terminal has both, insert mode is usually preferable
634 to __ich1__. Technically, you should not give both unless
635 the terminal actually requires both to be used in
636 combination. Accordingly, some non-curses applications get
637 confused if both are present; the symptom is doubled
638 characters in an update using insert. This requirement is
639 now rare; most __ich__ sequences do not require previous
640 smir, and most smir insert modes do not require __ich1__
641 before each character. Therefore, the new __curses__
642 actually assumes this is the case and uses either
643 __rmir__/__smir__ or __ich__/__ich1__ as
644 appropriate (but not both). If you have to write an entry to
645 be used under new curses for a terminal old enough to need
646 both, include the __rmir__/__smir__ sequences in
647 __ich1__.
648
649
650 If post insert padding is needed, give this as a number of
651 milliseconds in __ip__ (a string option). Any other
652 sequence which may need to be sent after an insert of a
653 single character may also be given in __ip__. If your
654 terminal needs both to be placed into an `insert mode' and a
655 special code to precede each inserted character, then both
656 __smir__/__rmir__ and __ich1__ can be given, and
657 both will be used. The __ich__ capability, with one
658 parameter, ''n'', will repeat the effects of __ich1__
659 ''n'' times.
660
661
662 If padding is necessary between characters typed while not
663 in insert mode, give this as a number of milliseconds
664 padding in __rmp__.
665
666
667 It is occasionally necessary to move around while in insert
668 mode to delete characters on the same line (e.g., if there
669 is a tab after the insertion position). If your terminal
670 allows motion while in insert mode you can give the
671 capability __mir__ to speed up inserting in this case.
672 Omitting __mir__ will affect only speed. Some terminals
673 (notably Datamedia's) must not have __mir__ because of
674 the way their insert mode works.
675
676
677 Finally, you can specify __dch1__ to delete a single
678 character, __dch__ with one parameter, ''n'', to
679 delete ''n characters,'' and delete mode by giving
680 __smdc__ and __rmdc__ to enter and exit delete mode
681 (any mode the terminal needs to be placed in for __dch1__
682 to work).
683
684
685 A command to erase ''n'' characters (equivalent to
686 outputting ''n'' blanks without moving the cursor) can be
687 given as __ech__ with one parameter.
688
689
690 __Highlighting, Underlining, and Visible
691 Bells__
692
693
694 If your terminal has one or more kinds of display
695 attributes, these can be represented in a number of
696 different ways. You should choose one display form as
697 ''standout mode'', representing a good, high contrast,
698 easy-on-the-eyes, format for highlighting error messages and
699 other attention getters. (If you have a choice, reverse
700 video plus half-bright is good, or reverse video alone.) The
701 sequences to enter and exit standout mode are given as
702 __smso__ and __rmso__, respectively. If the code to
703 change into or out of standout mode leaves one or even two
704 blank spaces on the screen, as the TVI 912 and Teleray 1061
705 do, then __xmc__ should be given to tell how many spaces
706 are left.
707
708
709 Codes to begin underlining and end underlining can be given
710 as __smul__ and __rmul__ respectively. If the terminal
711 has a code to underline the current character and move the
712 cursor one space to the right, such as the Microterm Mime,
713 this can be given as __uc__.
714
715
716 Other capabilities to enter various highlighting modes
717 include __blink__ (blinking) __bold__ (bold or extra
718 bright) __dim__ (dim or half-bright) __invis__
719 (blanking or invisible text) __prot__ (protected)
720 __rev__ (reverse video) __sgr0__ (turn off ''all''
721 attribute modes) __smacs__ (enter alternate character set
722 mode) and __rmacs__ (exit alternate character set mode).
723 Turning on any of these modes singly may or may not turn off
724 other modes.
725
726
727 If there is a sequence to set arbitrary combinations of
728 modes, this should be given as __sgr__ (set attributes),
729 taking 9 parameters. Each parameter is either 0 or nonzero,
730 as the corresponding attribute is on or off. The 9
731 parameters are, in order: standout, underline, reverse,
732 blink, dim, bold, blank, protect, alternate character set.
733 Not all modes need be supported by __sgr__, only those
734 for which corresponding separate attribute commands
735 exist.
736
737
2 StuartYeates 738 For example, the [DEC] vt220 supports most of the
1 perry 739 modes:
740
741
742 We begin each escape sequence by turning off any existing modes, since there is no quick way to determine whether they are active. Standout is set up to be the combination of reverse and bold. The vt220 terminal has a protect mode, though it is not commonly used in sgr because it protects characters on the screen from the host's erasures. The altcharset mode also is different in that it is either ^O or ^N, depending on whether it is off or on. If all modes are turned on, the resulting sequence is E[[0;1;4;5;7;8m^N.
743
744
745 Some sequences are common to different modes. For example,
746 ;7 is output when either p1 or p3 is true, that is, if
747 either standout or reverse modes are turned on.
748
749
750 Writing out the above sequences, along with their
751 dependencies yields
752
753
754 Putting this all together into the sgr sequence gives:
755
756
757 sgr=E[[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;
758 %?%p4%t;5%;%?%p7%t;8%;m%?%p9%t016%e017%;,
759 Remember that if you specify sgr, you must also specify sgr0.
760
761
762 Terminals with the ``magic cookie'' glitch (__xmc__)
763 deposit special ``cookies'' when they receive mode-setting
764 sequences, which affect the display algorithm rather than
765 having extra bits for each character. Some terminals, such
766 as the HP 2621, automatically leave standout mode when they
767 move to a new line or the cursor is addressed. Programs
768 using standout mode should exit standout mode before moving
769 the cursor or sending a newline, unless the __msgr__
770 capability, asserting that it is safe to move in standout
771 mode, is present.
772
773
774 If the terminal has a way of flashing the screen to indicate
775 an error quietly (a bell replacement) then this can be given
776 as __flash__; it must not move the cursor.
777
778
779 If the cursor needs to be made more visible than normal when
780 it is not on the bottom line (to make, for example, a
781 non-blinking underline into an easier to find block or
782 blinking underline) give this sequence as __cvvis__. If
783 there is a way to make the cursor completely invisible, give
784 that as __civis__. The capability __cnorm__ should be
785 given which undoes the effects of both of these
786 modes.
787
788
789 If your terminal correctly generates underlined characters
790 (with no special codes needed) even though it does not
791 overstrike, then you should give the capability __ul__.
792 If a character overstriking another leaves both characters
793 on the screen, specify the capability __os__. If
794 overstrikes are erasable with a blank, then this should be
795 indicated by giving __eo__.
796
797
798 __Keypad and Function Keys__
799
800
801 If the terminal has a keypad that transmits codes when the
802 keys are pressed, this information can be given. Note that
803 it is not possible to handle terminals where the keypad only
804 works in local (this applies, for example, to the unshifted
805 HP 2621 keys). If the keypad can be set to transmit or not
806 transmit, give these codes as __smkx__ and __rmkx__.
807 Otherwise the keypad is assumed to always transmit. The
808 codes sent by the left arrow, right arrow, up arrow, down
809 arrow, and home keys can be given as __kcub1, kcuf1, kcuu1,
810 kcud1,__ and __khome__ respectively. If there are
811 function keys such as f0, f1, ..., f10, the codes they send
812 can be given as __kf0, kf1, ..., kf10__. If these keys
813 have labels other than the default f0 through f10, the
814 labels can be given as __lf0, lf1, ..., lf10__. The codes
815 transmitted by certain other special keys can be given:
816 __kll__ (home down), __kbs__ (backspace), __ktbc__
817 (clear all tabs), __kctab__ (clear the tab stop in this
818 column), __kclr__ (clear screen or erase key),
819 __kdch1__ (delete character), __kdl1__ (delete line),
820 __krmir__ (exit insert mode), __kel__ (clear to end of
821 line), __ked__ (clear to end of screen), __kich1__
822 (insert character or enter insert mode), __kil1__ (insert
823 line), __knp__ (next page), __kpp__ (previous page),
824 __kind__ (scroll forward/down), __kri__ (scroll
825 backward/up), __khts__ (set a tab stop in this column).
826 In addition, if the keypad has a 3 by 3 array of keys
827 including the four arrow keys, the other five keys can be
828 given as __ka1__, __ka3__, __kb2__, __kc1__, and
829 __kc3__. These keys are useful when the effects of a 3 by
830 3 directional pad are needed.
831
832
833 Strings to program function keys can be given as
834 __pfkey__, __pfloc__, and __pfx__. A string to
835 program screen labels should be specified as __pln__.
836 Each of these strings takes two parameters: the function key
837 number to program (from 0 to 10) and the string to program
838 it with. Function key numbers out of this range may program
839 undefined keys in a terminal dependent manner. The
840 difference between the capabilities is that __pfkey__
841 causes pressing the given key to be the same as the user
842 typing the given string; __pfloc__ causes the string to
843 be executed by the terminal in local; and __pfx__ causes
844 the string to be transmitted to the computer.
845
846
847 The capabilities __nlab__, __lw__ and __lh__ define
848 the number of programmable screen labels and their width and
849 height. If there are commands to turn the labels on and off,
850 give them in __smln__ and __rmln__. __smln__ is
851 normally output after one or more pln sequences to make sure
852 that the change becomes visible.
853
854
855 __Tabs and Initialization__
856
857
858 If the terminal has hardware tabs, the command to advance to
859 the next tab stop can be given as __ht__ (usually control
860 I). A ``back-tab'' command which moves leftward to the
861 preceding tab stop can be given as __cbt__. By
862 convention, if the teletype modes indicate that tabs are
863 being expanded by the computer rather than being sent to the
864 terminal, programs should not use __ht__ or __cbt__
865 even if they are present, since the user may not have the
866 tab stops properly set. If the terminal has hardware tabs
867 which are initially set every ''n'' spaces when the
868 terminal is powered up, the numeric parameter __it__ is
869 given, showing the number of spaces the tabs are set to.
870 This is normally used by the ''tset'' command to
871 determine whether to set the mode for hardware tab
872 expansion, and whether to set the tab stops. If the terminal
873 has tab stops that can be saved in non-volatile memory, the
874 terminfo description can assume that they are properly
875 set.
876
877
878 Other capabilities include __is1__, __is2__, and
879 __is3__, initialization strings for the terminal,
880 __iprog__, the path name of a program to be run to
881 initialize the terminal, and __if__, the name of a file
882 containing long initialization strings. These strings are
883 expected to set the terminal into modes consistent with the
884 rest of the terminfo description. They are normally sent to
885 the terminal, by the ''init'' option of the ''tput''
886 program, each time the user logs in. They will be printed in
887 the following order: run the program __iprog__; output
888 __is1__; __is2__; set the margins using __mgc__,
889 __smgl__ and __smgr__; set tabs using __tbc__ and
890 __hts__; print the file __if__; and finally output
891 __is3__.
892
893
894 Most initialization is done with __is2__. Special
895 terminal modes can be set up without duplicating strings by
896 putting the common sequences in __is2__ and special cases
897 in __is1__ and __is3__. A pair of sequences that does
898 a harder reset from a totally unknown state can be
899 analogously given as __rs1__, __rs2__, __rf__, and
900 __rs3__, analogous to __is2__ and __if__. These
901 strings are output by the ''reset'' program, which is
902 used when the terminal gets into a wedged state. Commands
903 are normally placed in __rs1__, __rs2 rs3__ and
904 __rf__ only if they produce annoying effects on the
905 screen and are not necessary when logging in. For example,
906 the command to set the vt100 into 80-column mode would
907 normally be part of __is2__, but it causes an annoying
908 glitch of the screen and is not normally needed since the
909 terminal is usually already in 80 column mode.
910
911
912 If there are commands to set and clear tab stops, they can
913 be given as __tbc__ (clear all tab stops) and __hts__
914 (set a tab stop in the current column of every row). If a
915 more complex sequence is needed to set the tabs than can be
916 described by this, the sequence can be placed in __is2__
917 or __if__.
918
919
920 __Delays and Padding__
921
922
923 Many older and slower terminals don't support either
924 XON/XOFF or DTR handshaking, including hard copy terminals
925 and some very archaic CRTs (including, for example, DEC
926 VT100s). These may require padding characters after certain
927 cursor motions and screen changes.
928
929
930 If the terminal uses xon/xoff handshaking for flow control
931 (that is, it automatically emits ^S back to the host when
932 its input buffers are close to full), set __xon__. This
933 capability suppresses the emission of padding. You can also
934 set it for memory-mapped console devices effectively that
935 don't have a speed limit. Padding information should still
936 be included so that routines can make better decisions about
937 relative costs, but actual pad characters will not be
938 transmitted.
939
940
941 If __pb__ (padding baud rate) is given, padding is
942 suppressed at baud rates below the value of __pb__. If
943 the entry has no padding baud rate, then whether padding is
944 emitted or not is completely controlled by
945 __xon__.
946
947
948 If the terminal requires other than a null (zero) character
949 as a pad, then this can be given as __pad__. Only the
950 first character of the __pad__ string is
951 used.
952
953
954 __Status Lines__
955
956
957 Some terminals have an extra `status line' which is not
958 normally used by software (and thus not counted in the
959 terminal's __lines__ capability).
960
961
962 The simplest case is a status line which is
963 cursor-addressable but not part of the main scrolling region
964 on the screen; the Heathkit H19 has a status line of this
965 kind, as would a 24-line VT100 with a 23-line scrolling
966 region set up on initialization. This situation is indicated
967 by the __hs__ capability.
968
969
970 Some terminals with status lines need special sequences to
971 access the status line. These may be expressed as a string
972 with single parameter __tsl__ which takes the cursor to a
973 given zero-origin column on the status line. The capability
974 __fsl__ must return to the main-screen cursor positions
975 before the last __tsl__. You may need to embed the string
976 values of __sc__ (save cursor) and __rc__ (restore
977 cursor) in __tsl__ and __fsl__ to accomplish
978 this.
979
980
981 The status line is normally assumed to be the same width as
982 the width of the terminal. If this is untrue, you can
983 specify it with the numeric capability
984 __wsl__.
985
986
987 A command to erase or blank the status line may be specified
988 as __dsl__.
989
990
991 The boolean capability __eslok__ specifies that escape
992 sequences, tabs, etc., work ordinarily in the status
993 line.
994
995
996 The __ncurses__ implementation does not yet use any of
997 these capabilities. They are documented here in case they
998 ever become important.
999
1000
1001 __Line Graphics__
1002
1003
1004 Many terminals have alternate character sets useful for
1005 forms-drawing. Terminfo and __curses__ build in support
1006 for the drawing characters supported by the VT100, with some
1007 characters from the AT
1008 __acsc__
1009 capability.
1010
1011
1012 The best way to define a new device's graphics set is to add a column to a copy of this table for your terminal, giving the character which (when emitted between __smacs__/__rmacs__ switches) will be rendered as the corresponding graphic. Then read off the VT100/your terminal character pairs right to left in sequence; these become the ACSC string.
1013
1014
1015 __Color Handling__
1016
1017
1018 Most color terminals are either `Tektronix-like' or
1019 `HP-like'. Tektronix-like terminals have a predefined set of
1020 N colors (where N usually 8), and can set character-cell
1021 foreground and background characters independently, mixing
1022 them into N * N color-pairs. On HP-like terminals, the use
1023 must set each color pair up separately (foreground and
1024 background are not independently settable). Up to M
1025 color-pairs may be set up from 2*M different colors.
1026 ANSI-compatible terminals are Tektronix-like.
1027
1028
1029 Some basic color capabilities are independent of the color
1030 method. The numeric capabilities __colors__ and
1031 __pairs__ specify the maximum numbers of colors and
1032 color-pairs that can be displayed simultaneously. The
1033 __op__ (original pair) string resets foreground and
1034 background colors to their default values for the terminal.
1035 The __oc__ string resets all colors or color-pairs to
1036 their default values for the terminal. Some terminals
1037 (including many PC terminal emulators) erase screen areas
1038 with the current background color rather than the power-up
1039 default background; these should have the boolean capability
1040 __bce__.
1041
1042
1043 To change the current foreground or background color on a
1044 Tektronix-type terminal, use __setaf__ (set ANSI
1045 foreground) and __setab__ (set ANSI background) or
1046 __setf__ (set foreground) and __setb__ (set
1047 background). These take one parameter, the color number. The
1048 SVr4 documentation describes only __setaf__/__setab__;
1049 the XPG4 draft says that
1050 __setaf__ and __setab__,
1051 respectively. If the terminal supports other escape
1052 sequences to set background and foreground, they should be
1053 coded as __setf__ and __setb__, respectively. The
1054 ''vidputs()'' function and the refresh functions use
1055 __setaf__ and __setab__ if they are
1056 defined.__
1057
1058
1059 The __setaf__/__setab__ and __setf__/__setb__
1060 capabilities take a single numeric argument each. Argument
1061 values 0-7 are portably defined as follows (the middle
1062 column is the symbolic #define available in the header for
1063 the __curses__ or __ncurses__ libraries). The terminal
1064 hardware is free to map these as it likes, but the RGB
1065 values indicate normal locations in color
1066 space.
1067
1068
1069 On an HP-like terminal, use __scp__ with a color-pair number parameter to set which color pair is current.
1070
1071
1072 On a Tektronix-like terminal, the capability __ccc__ may
1073 be present to indicate that colors can be modified. If so,
1074 the __initc__ capability will take a color number (0 to
1075 __colors__ - 1)and three more parameters which describe
1076 the color. These three parameters default to being
1077 interpreted as RGB (Red, Green, Blue) values. If the boolean
1078 capability __hls__ is present, they are instead as HLS
1079 (Hue, Lightness, Saturation) indices. The ranges are
1080 terminal-dependent.
1081
1082
1083 On an HP-like terminal, __initp__ may give a capability
1084 for changing a color-pair value. It will take seven
1085 parameters; a color-pair number (0 to __max_pairs__ - 1),
1086 and two triples describing first background and then
1087 foreground colors. These parameters must be (Red, Green,
1088 Blue) or (Hue, Lightness, Saturation) depending on
1089 __hls__.
1090
1091
1092 On some color terminals, colors collide with highlights. You
1093 can register these collisions with the __ncv__
1094 capability. This is a bit-mask of attributes not to be used
1095 when colors are enabled. The correspondence with the
1096 attributes understood by __curses__ is as
1097 follows:
1098
1099
1100 For example, on many IBM PC consoles, the underline attribute collides with the foreground color blue and is not available in color mode. These should have an __ncv__ capability of 2.
1101
1102
1103 SVr4 curses does nothing with __ncv__, ncurses recognizes
1104 it and optimizes the output in favor of colors.
1105
1106
1107 __Miscellaneous__
1108
1109
1110 If the terminal requires other than a null (zero) character
1111 as a pad, then this can be given as pad. Only the first
1112 character of the pad string is used. If the terminal does
1113 not have a pad character, specify npc. Note that ncurses
1114 implements the termcap-compatible __PC__ variable; though
1115 the application may set this value to something other than a
1116 null, ncurses will test __npc__ first and use napms if
1117 the terminal has no pad character.
1118
1119
1120 If the terminal can move up or down half a line, this can be
1121 indicated with __hu__ (half-line up) and __hd__
1122 (half-line down). This is primarily useful for superscripts
1123 and subscripts on hard-copy terminals. If a hard-copy
1124 terminal can eject to the next page (form feed), give this
1125 as __ff__ (usually control L).
1126
1127
1128 If there is a command to repeat a given character a given
1129 number of times (to save time transmitting a large number of
1130 identical characters) this can be indicated with the
1131 parameterized string __rep__. The first parameter is the
1132 character to be repeated and the second is the number of
1133 times to repeat it. Thus, tparm(repeat_char, 'x', 10) is the
1134 same as `xxxxxxxxxx'.
1135
1136
1137 If the terminal has a settable command character, such as
1138 the TEKTRONIX 4025, this can be indicated
1139 with __cmdch__. A prototype command character is chosen
1140 which is used in all capabilities. This character is given
1141 in the __cmdch__ capability to identify it. The following
1142 convention is supported on some UNIX systems: The
1143 environment is to be searched for a __CC__ variable, and
1144 if found, all occurrences of the prototype character are
1145 replaced with the character in the environment
1146 variable.
1147
1148
1149 Terminal descriptions that do not represent a specific kind
1150 of known terminal, such as ''switch'', ''dialup'',
1151 ''patch'', and ''network'', should include the
1152 __gn__ (generic) capability so that programs can complain
1153 that they do not know how to talk to the terminal. (This
1154 capability does not apply to ''virtual'' terminal
1155 descriptions for which the escape sequences are
1156 known.)
1157
1158
1159 If the terminal has a ``meta key'' which acts as a shift
1160 key, setting the 8th bit of any character transmitted, this
1161 fact can be indicated with __km__. Otherwise, software
1162 will assume that the 8th bit is parity and it will usually
1163 be cleared. If strings exist to turn this ``meta mode'' on
1164 and off, they can be given as __smm__ and
1165 __rmm__.
1166
1167
1168 If the terminal has more lines of memory than will fit on
1169 the screen at once, the number of lines of memory can be
1170 indicated with __lm__. A value of __lm__#0 indicates
1171 that the number of lines is not fixed, but that there is
1172 still more memory than fits on the screen.
1173
1174
1175 If the terminal is one of those supported by the
1176 UNIX virtual terminal protocol, the terminal
1177 number can be given as __vt__.
1178
1179
1180 Media copy strings which control an auxiliary printer
1181 connected to the terminal can be given as __mc0__: print
1182 the contents of the screen, __mc4__: turn off the
1183 printer, and __mc5__: turn on the printer. When the
1184 printer is on, all text sent to the terminal will be sent to
1185 the printer. It is undefined whether the text is also
1186 displayed on the terminal screen when the printer is on. A
1187 variation __mc5p__ takes one parameter, and leaves the
1188 printer on for as many characters as the value of the
1189 parameter, then turns the printer off. The parameter should
1190 not exceed 255. All text, including __mc4__, is
1191 transparently passed to the printer while an __mc5p__ is
1192 in effect.
1193
1194
1195 __Glitches and Braindamage__
1196
1197
1198 Hazeltine terminals, which do not allow `~' characters to be
1199 displayed should indicate __hz__.
1200
1201
1202 Terminals which ignore a line-feed immediately after an
1203 __am__ wrap, such as the Concept and vt100, should
1204 indicate __xenl__.
1205
1206
1207 If __el__ is required to get rid of standout (instead of
1208 merely writing normal text on top of it), __xhp__ should
1209 be given.
1210
1211
1212 Teleray terminals, where tabs turn all characters moved over
1213 to blanks, should indicate __xt__ (destructive tabs).
1214 Note: the variable indicating this is now
1215 `dest_tabs_magic_smso'; in older versions, it was
1216 teleray_glitch. This glitch is also taken to mean that it is
1217 not possible to position the cursor on top of a ``magic
1218 cookie'', that to erase standout mode it is instead
1219 necessary to use delete and insert line. The ncurses
1220 implementation ignores this glitch.
1221
1222
1223 The Beehive Superbee, which is unable to correctly transmit
1224 the escape or control C characters, has __xsb__,
1225 indicating that the f1 key is used for escape and f2 for
1226 control C. (Only certain Superbees have this problem,
1227 depending on the ROM.) Note that in older terminfo versions,
1228 this capability was called `beehive_glitch'; it is now
1229 `no_esc_ctl_c'.
1230
1231
1232 Other specific terminal problems may be corrected by adding
1233 more capabilities of the form __x__''x''.
1234
1235
1236 __Similar Terminals__
1237
1238
1239 If there are two very similar terminals, one (the variant)
1240 can be defined as being just like the other (the base) with
1241 certain exceptions. In the definition of the variant, the
1242 string capability __use__ can be given with the name of
1243 the base terminal. The capabilities given before __use__
1244 override those in the base type named by __use__. If
1245 there are multiple __use__ capabilities, they are merged
1246 in reverse order. That is, the rightmost __use__
1247 reference is processed first, then the one to its left, and
1248 so forth. Capabilities given explicitly in the entry
1249 override those brought in by __use__
1250 references.
1251
1252
1253 A capability can be canceled by placing __xx@__ to the
1254 left of the use reference that imports it, where ''xx''
1255 is the capability. For example, the entry
1256
1257
1258 2621-nl, smkx@, rmkx@, use=2621,
1259
1260
1261 defines a 2621-nl that does not have the __smkx__ or
1262 __rmkx__ capabilities, and hence does not turn on the
1263 function key labels when in visual mode. This is useful for
1264 different modes for a terminal, or for different user
1265 preferences.
1266
1267
1268 __Pitfalls of Long Entries__
1269
1270
1271 Long terminfo entries are unlikely to be a problem; to date,
1272 no entry has even approached terminfo's 4K string-table
1273 maximum. Unfortunately, the termcap translations are much
1274 more strictly limited (to 1K), thus termcap translations of
1275 long terminfo entries can cause problems.
1276
1277
1278 The man pages for 4.3BSD and older versions of tgetent()
1279 instruct the user to allocate a 1K buffer for the termcap
1280 entry. The entry gets null-terminated by the termcap
1281 library, so that makes the maximum safe length for a termcap
1282 entry 1k-1 (1023) bytes. Depending on what the application
1283 and the termcap library being used does, and where in the
1284 termcap file the terminal type that tgetent() is searching
1285 for is, several bad things can happen.
1286
1287
1288 Some termcap libraries print a warning message or exit if
1289 they find an entry that's longer than 1023 bytes; others
1290 don't; others truncate the entries to 1023 bytes. Some
1291 application programs allocate more than the recommended 1K
1292 for the termcap entry; others don't.
1293
1294
1295 Each termcap entry has two important sizes associated with
1296 it: before
1297
1298
1299 The
1300
1301
1302 *
1303
1304
1305 a termcap entry before expansion is more than 1023 bytes
1306 long,
1307
1308
1309 *
1310
1311
1312 and the application has only allocated a 1k
1313 buffer,
1314
1315
1316 *
1317
1318
1319 and the termcap library (like the one in BSD/OS 1.1 and GNU)
1320 reads the whole entry into the buffer, no matter what its
1321 length, to see if it's the entry it wants,
1322
1323
1324 *
1325
1326
1327 and tgetent() is searching for a terminal type that either
1328 is the long entry, appears in the termcap file after the
1329 long entry, or doesn't appear in the file at all (so that
1330 tgetent() has to search the whole termcap
1331 file).
1332
1333
1334 Then tgetent() will overwrite memory, perhaps its stack, and
1335 probably core dump the program. Programs like telnet are
1336 particularly vulnerable; modern telnets pass along values
1337 like the terminal type automatically. The results are almost
1338 as undesirable with a termcap library, like SunOS 4.1.3 and
1339 Ultrix 4.4, that prints warning messages when it reads an
1340 overly long termcap entry. If a termcap library truncates
1341 long entries, like OSF/1 3.0, it is immune to dying here but
1342 will return incorrect data for the terminal.
1343
1344
1345 The
1346
1347
1348 In summary, a termcap entry that is longer than 1023 bytes
1349 can cause, on various combinations of termcap libraries and
1350 applications, a core dump, warnings, or incorrect operation.
1351 If it's too long even before
1352
1353
1354 When in -C (translate to termcap) mode, the __ncurses__
1355 implementation of tic(1) issues warning messages when
1356 the pre-tc length of a termcap translation is too long. The
1357 -c (check) option also checks resolved (after tc expansion)
1358 lengths.
1359
1360
1361 __Binary Compatibility__
1362
1363
1364 It is not wise to count on portability of binary terminfo
1365 entries between commercial UNIX versions. The problem is
1366 that there are at least two versions of terminfo (under
1367 HP-UX and AIX) which diverged from System V terminfo after
1368 SVr1, and have added extension capabilities to the string
1369 table that (in the binary format) collide with System V and
1370 XSI Curses extensions.
1371 !!EXTENSIONS
1372
1373
1374 Some SVr4 __curses__ implementations, and all previous to
1375 SVr4, don't interpret the %A and %O operators in parameter
1376 strings.
1377
1378
1379 SVr4/XPG4 do not specify whether __msgr__ licenses
1380 movement while in an alternate-character-set mode (such
1381 modes may, among other things, map CR and NL to characters
1382 that don't trigger local motions). The __ncurses__
1383 implementation ignores __msgr__ in __ALTCHARSET__
1384 mode. This raises the possibility that an XPG4
1385 implementation making the opposite interpretation may need
1386 terminfo entries made for __ncurses__ to have __msgr__
1387 turned off.
1388
1389
1390 The __ncurses__ library handles insert-character and
1391 insert-character modes in a slightly non-standard way to get
1392 better update efficiency. See the __Insert/Delete
1393 Character__ subsection above.
1394
1395
1396 The parameter substitutions for __set_clock__ and
1397 __display_clock__ are not documented in SVr4 or the XSI
1398 Curses standard. They are deduced from the documentation for
1399 the AT__
1400
1401
1402 Be careful assigning the __kmous__ capability. The
1403 __ncurses__ wants to interpret it as __KEY_MOUSE__,
1404 for use by terminals and emulators like xterm that can
1405 return mouse-tracking information in the keyboard-input
1406 stream.
1407
1408
1409 Different commercial ports of terminfo and curses support
1410 different subsets of the XSI Curses standard and (in some
1411 cases) different extension sets. Here is a summary, accurate
1412 as of October 1995:
1413
1414
1415 __SVR4, Solaris, ncurses__ -- These support all SVr4
1416 capabilities.
1417
1418
2 StuartYeates 1419 __[SGI]__ -- Supports the SVr4 set, adds one undocumented
1 perry 1420 extended string capability (__set_pglen__).
1421
1422
2 StuartYeates 1423 __SVr1, [Ultrix]__ -- These support a restricted subset of
1 perry 1424 terminfo capabilities. The booleans end with
1425 __xon_xoff__; the numerics with __width_status_line__;
1426 and the strings with __prtr_non__.
1427
1428
2 StuartYeates 1429 __[HP]/UX__ -- Supports the SVr1 subset, plus the SVr[[234]
1 perry 1430 numerics __num_labels__, __label_height__,
1431 __label_width__, plus function keys 11 through 63, plus
1432 __plab_norm__, __label_on__, and __label_off__,
1433 plus some incompatible extensions in the string
1434 table.
1435
1436
2 StuartYeates 1437 __[AIX]__ -- Supports the SVr1 subset, plus function keys
1 perry 1438 11 through 63, plus a number of incompatible string table
1439 extensions.
1440
1441
2 StuartYeates 1442 __OSF__ -- Supports both the SVr4 set and the [AIX]
1 perry 1443 extensions.
1444 !!FILES
1445
1446
1447 /usr/share/terminfo/?/*
1448
1449
1450 files containing terminal descriptions
1451 !!SEE ALSO
1452
1453
2 StuartYeates 1454 __tic__(1M), __curses__(3X), __[printf(3)]__,
1 perry 1455 term(5).
1456 !!AUTHORS
1457
1458
1459 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey. Based
1460 on pcurses by Pavel Curtis.
1461 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 3 times)