1 .\" $Id: terminfo.tail,v 1.67 2013/08/31 12:11:03 tom Exp $
2 .\" Beginning of terminfo.tail file
3 .\" This file is part of ncurses.
4 .\" See "terminfo.head" for copyright.
6 .SS User-Defined Capabilities
8 The preceding section listed the \fIpredefined\fP capabilities.
9 They deal with some special features for terminals no longer
10 (or possibly never) produced.
11 Occasionally there are special features of newer terminals which
12 are awkward or impossible to represent by reusing the predefined
15 \fBncurses\fP addresses this limitation by allowing user-defined capabilities.
16 The \fB@TIC@\fP and \fB@INFOCMP@\fP programs provide
17 the \fB\-x\fP option for this purpose.
18 When \fB\-x\fP is set,
19 \fB@TIC@\fP treats unknown capabilities as user-defined.
20 That is, if \fB@TIC@\fP encounters a capability name
21 which it does not recognize,
22 it infers its type (boolean, number or string) from the syntax
23 and makes an extended table entry for that capability.
24 The \fBuse_extended_names\fP function makes this information
25 conditionally available to applications.
26 The ncurses library provides the data leaving most of the behavior
29 User-defined capability strings whose name begins
30 with \*(``k\*('' are treated as function keys.
32 The types (boolean, number, string) determined by \fB@TIC@\fP
33 can be inferred by successful calls on \fBtigetflag\fP, etc.
35 If the capability name happens to be two characters,
36 the capability is also available through the termcap interface.
38 While termcap is said to be extensible because it does not use a predefined set
40 in practice it has been limited to the capabilities defined by
41 terminfo implementations.
43 user-defined capabilities intended for use by termcap applications should
44 be limited to booleans and numbers to avoid running past the 1023 byte
45 limit assumed by termcap implementations and their applications.
46 In particular, providing extended sets of function keys (past the 60
47 numbered keys and the handful of special named keys) is best done using
48 the longer names available using terminfo.
52 The following entry, describing an ANSI-standard terminal, is representative
53 of what a \fBterminfo\fR entry for a modern terminal typically looks like.
57 \s-2ansi|ansi/pc-term compatible with color,
59 colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,
60 acsc=+\\020\\,\\021-\\030.^Y0\\333`\\004a\\261f\\370g\\361h\\260
61 j\\331k\\277l\\332m\\300n\\305o~p\\304q\\304r\\304s_t\\303
62 u\\264v\\301w\\302x\\263y\\363z\\362{\\343|\\330}\\234~\\376,
63 bel=^G, blink=\\E[5m, bold=\\E[1m, cbt=\\E[Z, clear=\\E[H\\E[J,
64 cr=^M, cub=\\E[%p1%dD, cub1=\\E[D, cud=\\E[%p1%dB, cud1=\\E[B,
65 cuf=\\E[%p1%dC, cuf1=\\E[C, cup=\\E[%i%p1%d;%p2%dH,
66 cuu=\\E[%p1%dA, cuu1=\\E[A, dch=\\E[%p1%dP, dch1=\\E[P,
67 dl=\\E[%p1%dM, dl1=\\E[M, ech=\\E[%p1%dX, ed=\\E[J, el=\\E[K,
68 el1=\\E[1K, home=\\E[H, hpa=\\E[%i%p1%dG, ht=\\E[I, hts=\\EH,
69 ich=\\E[%p1%d@, il=\\E[%p1%dL, il1=\\E[L, ind=^J,
70 indn=\\E[%p1%dS, invis=\\E[8m, kbs=^H, kcbt=\\E[Z, kcub1=\\E[D,
71 kcud1=\\E[B, kcuf1=\\E[C, kcuu1=\\E[A, khome=\\E[H, kich1=\\E[L,
72 mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S, op=\\E[39;49m,
73 rep=%p1%c\\E[%p2%{1}%-%db, rev=\\E[7m, rin=\\E[%p1%dT,
74 rmacs=\\E[10m, rmpch=\\E[10m, rmso=\\E[m, rmul=\\E[m,
75 s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B, s3ds=\\E+B,
76 setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm,
77 sgr=\\E[0;10%?%p1%t;7%;
84 sgr0=\\E[0;10m, smacs=\\E[11m, smpch=\\E[11m, smso=\\E[7m,
85 smul=\\E[4m, tbc=\\E[3g, u6=\\E[%i%d;%dR, u7=\\E[6n,
86 u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%i%p1%dd,
90 Entries may continue onto multiple lines by placing white space at
91 the beginning of each line except the first.
92 Comments may be included on lines beginning with \*(``#\*(''.
97 Boolean capabilities which indicate that the terminal has
98 some particular feature,
100 numeric capabilities giving the size of the terminal
101 or the size of particular delays, and
104 capabilities, which give a sequence which can be used to perform particular
107 .SS Types of Capabilities
109 All capabilities have names.
110 For instance, the fact that
111 ANSI-standard terminals have
112 .I "automatic margins"
113 (i.e., an automatic return and line-feed
114 when the end of a line is reached) is indicated by the capability \fBam\fR.
115 Hence the description of ansi includes \fBam\fR.
116 Numeric capabilities are followed by the character `#' and then a positive value.
117 Thus \fBcols\fR, which indicates the number of columns the terminal has,
118 gives the value `80' for ansi.
119 Values for numeric capabilities may be specified in decimal, octal or hexadecimal,
120 using the C programming language conventions (e.g., 255, 0377 and 0xff or 0xFF).
122 Finally, string valued capabilities, such as \fBel\fR (clear to end of line
123 sequence) are given by the two-character code, an `=', and then a string
124 ending at the next following `,'.
126 A number of escape sequences are provided in the string valued capabilities
127 for easy encoding of characters there.
128 Both \fB\eE\fR and \fB\ee\fR
129 map to an \s-1ESCAPE\s0 character,
130 \fB^x\fR maps to a control-x for any appropriate x, and the sequences
131 \fB\en \el \er \et \eb \ef \es\fR give
132 a newline, line-feed, return, tab, backspace, form-feed, and space.
133 Other escapes include
135 \fB\e^\fR for \fB^\fR,
137 \fB\e\e\fR for \fB\e\fR,
141 \fB\e:\fR for \fB:\fR,
143 and \fB\e0\fR for null.
145 \fB\e0\fR will produce \e200, which does not terminate a string but behaves
146 as a null character on most terminals, providing CS7 is specified.
149 The reason for this quirk is to maintain binary compatibility of the
150 compiled terminfo files with other implementations,
151 e.g., the SVr4 systems, which document this.
152 Compiled terminfo files use null-terminated strings, with no lengths.
153 Modifying this would require a new binary format,
154 which would not work with other implementations.
156 Finally, characters may be given as three octal digits after a \fB\e\fR.
158 A delay in milliseconds may appear anywhere in a string capability, enclosed in
159 $<..> brackets, as in \fBel\fP=\eEK$<5>, and padding characters are supplied by
161 to provide this delay.
162 The delay must be a number with at most one decimal
163 place of precision; it may be followed by suffixes `*' or '/' or both.
165 indicates that the padding required is proportional to the number of lines
166 affected by the operation, and the amount given is the per-affected-unit
168 (In the case of insert character, the factor is still the
171 affected.) Normally, padding is advisory if the device has the \fBxon\fR
172 capability; it is used for cost computation but does not trigger delays.
174 suffix indicates that the padding is mandatory and forces a delay of the given
175 number of milliseconds even on devices for which \fBxon\fR is present to
176 indicate flow control.
178 Sometimes individual capabilities must be commented out.
179 To do this, put a period before the capability name.
180 For example, see the second
182 in the example above.
186 .SS Fetching Compiled Descriptions
188 The \fBncurses\fP library searches for terminal descriptions in several places.
189 It uses only the first description found.
190 The library has a compiled-in list of places to search
191 which can be overridden by environment variables.
192 Before starting to search,
193 \fBncurses\fP eliminates duplicates in its search list.
195 If the environment variable TERMINFO is set, it is interpreted as the pathname
196 of a directory containing the compiled description you are working on.
197 Only that directory is searched.
199 If TERMINFO is not set,
200 \fBncurses\fR will instead look in the directory \fB$HOME/.terminfo\fR
201 for a compiled description.
203 Next, if the environment variable TERMINFO_DIRS is set,
204 \fBncurses\fR will interpret the contents of that variable
205 as a list of colon-separated directories (or database files) to be searched.
207 An empty directory name (i.e., if the variable begins or ends
208 with a colon, or contains adacent colons)
209 is interpreted as the system location \fI\*d\fR.
211 Finally, \fBncurses\fP searches these compiled-in locations:
214 a list of directories (@TERMINFO_DIRS@), and
216 the system terminfo directory, \fI\*d\fR (the compiled-in default).
218 .SS Preparing Descriptions
220 We now outline how to prepare descriptions of terminals.
221 The most effective way to prepare a terminal description is by imitating
222 the description of a similar terminal in
224 and to build up a description gradually, using partial descriptions
227 or some other screen-oriented program to check that they are correct.
228 Be aware that a very unusual terminal may expose deficiencies in
232 or bugs in the screen-handling code of the test program.
234 To get the padding for insert line right (if the terminal manufacturer
235 did not document it) a severe test is to edit a large file at 9600 baud,
236 delete 16 or so lines from the middle of the screen, then hit the `u'
237 key several times quickly.
238 If the terminal messes up, more padding is usually needed.
239 A similar test can be used for insert character.
241 .SS Basic Capabilities
243 The number of columns on each line for the terminal is given by the
244 \fBcols\fR numeric capability.
245 If the terminal is a \s-1CRT\s0, then the
246 number of lines on the screen is given by the \fBlines\fR capability.
247 If the terminal wraps around to the beginning of the next line when
248 it reaches the right margin, then it should have the \fBam\fR capability.
249 If the terminal can clear its screen, leaving the cursor in the home
250 position, then this is given by the \fBclear\fR string capability.
251 If the terminal overstrikes
252 (rather than clearing a position when a character is struck over)
253 then it should have the \fBos\fR capability.
254 If the terminal is a printing terminal, with no soft copy unit,
260 applies to storage scope terminals, such as \s-1TEKTRONIX\s+1 4010
261 series, as well as hard copy and APL terminals.)
262 If there is a code to move the cursor to the left edge of the current
265 (Normally this will be carriage return, control M.)
266 If there is a code to produce an audible signal (bell, beep, etc)
270 If there is a code to move the cursor one position to the left
271 (such as backspace) that capability should be given as
273 Similarly, codes to move to the right, up, and down should be
279 These local cursor motions should not alter the text they pass over,
280 for example, you would not normally use `\fBcuf1\fP=\ ' because the
281 space would erase the character moved over.
283 A very important point here is that the local cursor motions encoded
286 are undefined at the left and top edges of a \s-1CRT\s0 terminal.
287 Programs should never attempt to backspace around the left edge,
291 and never attempt to go up locally off the top.
292 In order to scroll text up, a program will go to the bottom left corner
293 of the screen and send the
297 To scroll text down, a program goes to the top left corner
298 of the screen and sends the
300 (reverse index) string.
305 are undefined when not on their respective corners of the screen.
307 Parameterized versions of the scrolling sequences are
311 which have the same semantics as
315 except that they take one parameter, and scroll that many lines.
316 They are also undefined except at the appropriate edge of the screen.
318 The \fBam\fR capability tells whether the cursor sticks at the right
319 edge of the screen when text is output, but this does not necessarily
322 from the last column.
323 The only local motion which is defined from the left edge is if
327 from the left edge will move to the right edge of the previous row.
330 is not given, the effect is undefined.
331 This is useful for drawing a box around the edge of the screen, for example.
332 If the terminal has switch selectable automatic margins,
335 file usually assumes that this is on; i.e., \fBam\fR.
336 If the terminal has a command which moves to the first column of the next
337 line, that command can be given as
340 It does not matter if the command clears the remainder of the current line,
341 so if the terminal has no
345 it may still be possible to craft a working
347 out of one or both of them.
349 These capabilities suffice to describe hard-copy and \*(lqglass-tty\*(rq terminals.
350 Thus the model 33 teletype is described as
356 \s-133\||\|tty33\||\|tty\||\|model 33 teletype,
357 bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\s+1
362 while the Lear Siegler \s-1ADM-3\s0 is described as
368 \s-1adm3\||\|3\||\|lsi adm3,
369 am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
370 ind=^J, lines#24,\s+1
375 .SS Parameterized Strings
377 Cursor addressing and other strings requiring parameters
378 in the terminal are described by a
379 parameterized string capability, with
381 like escapes \fB%x\fR in it.
382 For example, to address the cursor, the
384 capability is given, using two parameters:
385 the row and column to address to.
386 (Rows and columns are numbered from zero and refer to the
387 physical screen visible to the user, not to any unseen memory.)
388 If the terminal has memory relative cursor addressing,
389 that can be indicated by
392 The parameter mechanism uses a stack and special \fB%\fP codes
394 Typically a sequence will push one of the
395 parameters onto the stack and then print it in some format.
396 Print (e.g., "%d") is a special case.
397 Other operations, including "%t" pop their operand from the stack.
398 It is noted that more complex operations are often necessary,
399 e.g., in the \fBsgr\fP string.
401 The \fB%\fR encodings have the following meanings:
407 %\fI[[\fP:\fI]flags][width[.precision]][\fPdoxXs\fI]\fP
408 as in \fBprintf\fP, flags are [\-+#] and space.
409 Use a `:' to allow the next character to be a `\-' flag,
410 avoiding interpreting "%\-" as an operator.
413 print pop() like %c in \fBprintf\fP
416 print pop() like %s in \fBprintf\fP
419 push \fIi\fP'th parameter
422 set dynamic variable [a\-z] to pop()
425 get dynamic variable [a\-z] and push it
428 set static variable [a\-z] to pop()
431 get static variable [a\-z] and push it
433 The terms "static" and "dynamic" are misleading.
434 Historically, these are simply two different sets of variables,
435 whose values are not reset between calls to \fBtparm\fP.
436 However, that fact is not documented in other implementations.
437 Relying on it will adversely impact portability to other implementations.
440 char constant \fIc\fP
443 integer constant \fInn\fP
449 arithmetic (%m is mod): push(pop() op pop())
452 bit operations (AND, OR and exclusive-OR): push(pop() op pop())
455 logical operations: push(pop() op pop())
458 logical AND and OR operations (for conditionals)
461 unary operations (logical and bit complement): push(op pop())
464 add 1 to first two parameters (for ANSI terminals)
466 %? \fIexpr\fP %t \fIthenpart\fP %e \fIelsepart\fP %;
467 This forms an if-then-else.
468 The %e \fIelsepart\fP is optional.
469 Usually the %? \fIexpr\fP part pushes a value onto the stack,
470 and %t pops it from the stack, testing if it is nonzero (true).
471 If it is zero (false), control passes to the %e (else) part.
473 It is possible to form else-if's a la Algol 68:
475 %? c\d1\u %t b\d1\u %e c\d2\u %t b\d2\u %e c\d3\u %t b\d3\u %e c\d4\u %t b\d4\u %e %;
478 where c\di\u are conditions, b\di\u are bodies.
480 Use the \fB\-f\fP option of \fB@TIC@\fP or \fB@INFOCMP@\fP to see
481 the structure of if-then-else's.
482 Some strings, e.g., \fBsgr\fP can be very complicated when written
484 The \fB\-f\fP option splits the string into lines with the parts indented.
486 Binary operations are in postfix form with the operands in the usual order.
487 That is, to get x\-5 one would use "%gx%{5}%-".
488 %P and %g variables are
489 persistent across escape-string evaluations.
491 Consider the HP2645, which, to get to row 3 and column 12, needs
492 to be sent \eE&a12c03Y padded for 6 milliseconds.
494 of the rows and columns is inverted here, and that the row and column
495 are printed as two digits.
496 Thus its \fBcup\fR capability is \*(lqcup=6\eE&%p2%2dc%p1%2dY\*(rq.
498 The Microterm \s-1ACT-IV\s0 needs the current row and column sent
499 preceded by a \fB^T\fR, with the row and column simply encoded in binary,
500 \*(lqcup=^T%p1%c%p2%c\*(rq.
501 Terminals which use \*(lq%c\*(rq need to be able to
502 backspace the cursor (\fBcub1\fR),
503 and to move the cursor up one line on the screen (\fBcuu1\fR).
504 This is necessary because it is not always safe to transmit \fB\en\fR
505 \fB^D\fR and \fB\er\fR, as the system may change or discard them.
506 (The library routines dealing with terminfo set tty modes so that
507 tabs are never expanded, so \et is safe to send.
508 This turns out to be essential for the Ann Arbor 4080.)
510 A final example is the \s-1LSI ADM\s0-3a, which uses row and column
511 offset by a blank character, thus \*(lqcup=\eE=%p1%' '%+%c%p2%' '%+%c\*(rq.
512 After sending `\eE=', this pushes the first parameter, pushes the
513 ASCII value for a space (32), adds them (pushing the sum on the stack
514 in place of the two previous values) and outputs that value as a character.
515 Then the same is done for the second parameter.
516 More complex arithmetic is possible using the stack.
520 If the terminal has a fast way to home the cursor
521 (to very upper left corner of screen) then this can be given as
522 \fBhome\fR; similarly a fast way of getting to the lower left-hand corner
523 can be given as \fBll\fR; this may involve going up with \fBcuu1\fR
524 from the home position,
525 but a program should never do this itself (unless \fBll\fR does) because it
526 can make no assumption about the effect of moving up from the home position.
527 Note that the home position is the same as addressing to (0,0):
528 to the top left corner of the screen, not of memory.
529 (Thus, the \eEH sequence on HP terminals cannot be used for
532 If the terminal has row or column absolute cursor addressing,
533 these can be given as single parameter capabilities
535 (horizontal position absolute)
538 (vertical position absolute).
539 Sometimes these are shorter than the more general two parameter
540 sequence (as with the hp2645) and can be used in preference to
542 If there are parameterized local motions (e.g., move
544 spaces to the right) these can be given as
550 with a single parameter indicating how many spaces to move.
551 These are primarily useful if the terminal does not have
553 such as the \s-1TEKTRONIX\s+1 4025.
555 If the terminal needs to be in a special mode when running
556 a program that uses these capabilities,
557 the codes to enter and exit this mode can be given as \fBsmcup\fR and \fBrmcup\fR.
558 This arises, for example, from terminals like the Concept with more than
560 If the terminal has only memory relative cursor addressing and not screen
561 relative cursor addressing, a one screen-sized window must be fixed into
562 the terminal for cursor addressing to work properly.
563 This is also used for the \s-1TEKTRONIX\s+1 4025,
566 sets the command character to be the one used by terminfo.
567 If the \fBsmcup\fP sequence will not restore the screen after an
568 \fBrmcup\fP sequence is output (to the state prior to outputting
569 \fBrmcup\fP), specify \fBnrrmc\fP.
573 If the terminal can clear from the current position to the end of the
574 line, leaving the cursor where it is, this should be given as \fBel\fR.
575 If the terminal can clear from the beginning of the line to the current
576 position inclusive, leaving
577 the cursor where it is, this should be given as \fBel1\fP.
578 If the terminal can clear from the current position to the end of the
579 display, then this should be given as \fBed\fR.
580 \fBEd\fR is only defined from the first column of a line.
581 (Thus, it can be simulated by a request to delete a large number of lines,
586 .SS Insert/delete line and vertical motions
588 If the terminal can open a new blank line before the line where the cursor
589 is, this should be given as \fBil1\fR; this is done only from the first
591 The cursor must then appear on the newly blank line.
592 If the terminal can delete the line which the cursor is on, then this
593 should be given as \fBdl1\fR; this is done only from the first position on
594 the line to be deleted.
599 which take a single parameter and insert or delete that many lines can
605 If the terminal has a settable scrolling region (like the vt100)
606 the command to set this can be described with the
608 capability, which takes two parameters:
609 the top and bottom lines of the scrolling region.
610 The cursor position is, alas, undefined after using this command.
612 It is possible to get the effect of insert or delete line using
614 on a properly chosen region; the
618 (save and restore cursor) commands may be useful for ensuring that
619 your synthesized insert/delete string does not move the cursor.
620 (Note that the \fBncurses\fR(3X) library does this synthesis
621 automatically, so you need not compose insert/delete strings for
622 an entry with \fBcsr\fR).
624 Yet another way to construct insert and delete might be to use a combination of
625 index with the memory-lock feature found on some terminals (like the HP\-700/90
626 series, which however also has insert/delete).
628 Inserting lines at the top or bottom of the screen can also be
633 on many terminals without a true insert/delete line,
634 and is often faster even on terminals with those features.
636 The boolean \fBnon_dest_scroll_region\fR should be set if each scrolling
637 window is effectively a view port on a screen-sized canvas.
639 this capability, create a scrolling region in the middle of the screen,
640 write something to the bottom line, move the cursor to the top of the region,
641 and do \fBri\fR followed by \fBdl1\fR or \fBind\fR.
643 off the bottom of the region by the \fBri\fR re-appears, then scrolling
645 System V and XSI Curses expect that \fBind\fR, \fBri\fR,
646 \fBindn\fR, and \fBrin\fR will simulate destructive scrolling; their
647 documentation cautions you not to define \fBcsr\fR unless this is true.
648 This \fBcurses\fR implementation is more liberal and will do explicit erases
649 after scrolling if \fBndstr\fR is defined.
651 If the terminal has the ability to define a window as part of
652 memory, which all commands affect,
653 it should be given as the parameterized string
655 The four parameters are the starting and ending lines in memory
656 and the starting and ending columns in memory, in that order.
658 If the terminal can retain display memory above, then the
659 \fBda\fR capability should be given; if display memory can be retained
660 below, then \fBdb\fR should be given.
662 that deleting a line or scrolling may bring non-blank lines up from below
663 or that scrolling back with \fBri\fR may bring down non-blank lines.
665 .SS Insert/Delete Character
667 There are two basic kinds of intelligent terminals with respect to
668 insert/delete character which can be described using
670 The most common insert/delete character operations affect only the characters
671 on the current line and shift characters off the end of the line rigidly.
672 Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make
673 a distinction between typed and untyped blanks on the screen, shifting
674 upon an insert or delete only to an untyped blank on the screen which is
675 either eliminated, or expanded to two untyped blanks.
677 You can determine the
678 kind of terminal you have by clearing the screen and then typing
679 text separated by cursor motions.
680 Type \*(lqabc\ \ \ \ def\*(rq using local
681 cursor motions (not spaces) between the \*(lqabc\*(rq and the \*(lqdef\*(rq.
682 Then position the cursor before the \*(lqabc\*(rq and put the terminal in insert
684 If typing characters causes the rest of the line to shift
685 rigidly and characters to fall off the end, then your terminal does
686 not distinguish between blanks and untyped positions.
688 shifts over to the \*(lqdef\*(rq which then move together around the end of the
689 current line and onto the next as you insert, you have the second type of
690 terminal, and should give the capability \fBin\fR, which stands for
691 \*(lqinsert null\*(rq.
693 While these are two logically separate attributes (one line versus multi-line
694 insert mode, and special treatment of untyped spaces) we have seen no
695 terminals whose insert mode cannot be described with the single attribute.
697 Terminfo can describe both terminals which have an insert mode, and terminals
698 which send a simple sequence to open a blank position on the current line.
699 Give as \fBsmir\fR the sequence to get into insert mode.
700 Give as \fBrmir\fR the sequence to leave insert mode.
701 Now give as \fBich1\fR any sequence needed to be sent just before sending
702 the character to be inserted.
703 Most terminals with a true insert mode
704 will not give \fBich1\fR; terminals which send a sequence to open a screen
705 position should give it here.
707 If your terminal has both, insert mode is usually preferable to \fBich1\fR.
708 Technically, you should not give both unless the terminal actually requires
709 both to be used in combination.
710 Accordingly, some non-curses applications get
711 confused if both are present; the symptom is doubled characters in an update
713 This requirement is now rare; most \fBich\fR sequences do not
714 require previous smir, and most smir insert modes do not require \fBich1\fR
715 before each character.
716 Therefore, the new \fBcurses\fR actually assumes this
717 is the case and uses either \fBrmir\fR/\fBsmir\fR or \fBich\fR/\fBich1\fR as
718 appropriate (but not both).
719 If you have to write an entry to be used under
720 new curses for a terminal old enough to need both, include the
721 \fBrmir\fR/\fBsmir\fR sequences in \fBich1\fR.
723 If post insert padding is needed, give this as a number of milliseconds
724 in \fBip\fR (a string option).
725 Any other sequence which may need to be
726 sent after an insert of a single character may also be given in \fBip\fR.
727 If your terminal needs both to be placed into an `insert mode' and
728 a special code to precede each inserted character, then both
732 can be given, and both will be used.
735 capability, with one parameter,
737 will repeat the effects of
742 If padding is necessary between characters typed while not
743 in insert mode, give this as a number of milliseconds padding in \fBrmp\fP.
745 It is occasionally necessary to move around while in insert mode
746 to delete characters on the same line (e.g., if there is a tab after
747 the insertion position).
748 If your terminal allows motion while in
749 insert mode you can give the capability \fBmir\fR to speed up inserting
751 Omitting \fBmir\fR will affect only speed.
753 (notably Datamedia's) must not have \fBmir\fR because of the way their
756 Finally, you can specify
758 to delete a single character,
764 and delete mode by giving \fBsmdc\fR and \fBrmdc\fR
765 to enter and exit delete mode (any mode the terminal needs to be placed
772 characters (equivalent to outputting
774 blanks without moving the cursor)
779 .SS "Highlighting, Underlining, and Visible Bells"
781 If your terminal has one or more kinds of display attributes,
782 these can be represented in a number of different ways.
783 You should choose one display form as
785 representing a good, high contrast, easy-on-the-eyes,
786 format for highlighting error messages and other attention getters.
787 (If you have a choice, reverse video plus half-bright is good,
788 or reverse video alone.)
789 The sequences to enter and exit standout mode
790 are given as \fBsmso\fR and \fBrmso\fR, respectively.
791 If the code to change into or out of standout
792 mode leaves one or even two blank spaces on the screen,
793 as the TVI 912 and Teleray 1061 do,
794 then \fBxmc\fR should be given to tell how many spaces are left.
796 Codes to begin underlining and end underlining can be given as \fBsmul\fR
797 and \fBrmul\fR respectively.
798 If the terminal has a code to underline the current character and move
799 the cursor one space to the right,
800 such as the Microterm Mime,
801 this can be given as \fBuc\fR.
803 Other capabilities to enter various highlighting modes include
807 (bold or extra bright)
811 (blanking or invisible text)
821 (enter alternate character set mode)
824 (exit alternate character set mode).
825 Turning on any of these modes singly may or may not turn off other modes.
827 If there is a sequence to set arbitrary combinations of modes,
828 this should be given as
832 Each parameter is either 0 or nonzero, as the corresponding attribute is on or off.
833 The 9 parameters are, in order:
834 standout, underline, reverse, blink, dim, bold, blank, protect, alternate
836 Not all modes need be supported by
838 only those for which corresponding separate attribute commands exist.
840 For example, the DEC vt220 supports most of the modes:
847 \fBtparm parameter attribute escape sequence\fP
850 p1 standout \\E[0;1;7m
851 p2 underline \\E[0;4m
858 p9 altcharset ^O (off) ^N (on)
861 We begin each escape sequence by turning off any existing modes, since
862 there is no quick way to determine whether they are active.
863 Standout is set up to be the combination of reverse and bold.
864 The vt220 terminal has a protect mode,
865 though it is not commonly used in sgr
866 because it protects characters on the screen from the host's erasures.
867 The altcharset mode also is different in that it is either ^O or ^N,
868 depending on whether it is off or on.
869 If all modes are turned on, the resulting sequence is \\E[0;1;4;5;7;8m^N.
871 Some sequences are common to different modes.
872 For example, ;7 is output when either p1 or p3 is true, that is, if
873 either standout or reverse modes are turned on.
875 Writing out the above sequences, along with their dependencies yields
883 \fBsequence when to output terminfo translation\fP
887 ;1 if p1 or p6 %?%p1%p6%|%t;1%;
888 ;4 if p2 %?%p2%|%t;4%;
889 ;5 if p4 %?%p4%|%t;5%;
890 ;7 if p1 or p3 %?%p1%p3%|%t;7%;
891 ;8 if p7 %?%p7%|%t;8%;
893 ^N or ^O if p9 ^N, else ^O %?%p9%t^N%e^O%;
897 Putting this all together into the sgr sequence gives:
901 sgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p4%t;5%;
902 %?%p1%p3%|%t;7%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;,
906 Remember that if you specify sgr, you must also specify sgr0.
907 Also, some implementations rely on sgr being given if sgr0 is,
908 Not all terminfo entries necessarily have an sgr string, however.
909 Many terminfo entries are derived from termcap entries
910 which have no sgr string.
911 The only drawback to adding an sgr string is that termcap also
912 assumes that sgr0 does not exit alternate character set mode.
914 Terminals with the \*(``magic cookie\*('' glitch
916 deposit special \*(``cookies\*('' when they receive mode-setting sequences,
917 which affect the display algorithm rather than having extra bits for
919 Some terminals, such as the HP 2621, automatically leave standout
920 mode when they move to a new line or the cursor is addressed.
921 Programs using standout mode should exit standout mode before
922 moving the cursor or sending a newline,
925 capability, asserting that it is safe to move in standout mode, is present.
928 a way of flashing the screen to indicate an error quietly (a bell replacement)
929 then this can be given as \fBflash\fR; it must not move the cursor.
931 If the cursor needs to be made more visible than normal when it is
932 not on the bottom line (to make, for example, a non-blinking underline into an
933 easier to find block or blinking underline)
934 give this sequence as
936 If there is a way to make the cursor completely invisible, give that as
940 should be given which undoes the effects of both of these modes.
942 If your terminal correctly generates underlined characters
943 (with no special codes needed)
944 even though it does not overstrike,
945 then you should give the capability \fBul\fR.
946 If a character overstriking another leaves both characters on the screen,
947 specify the capability \fBos\fP.
948 If overstrikes are erasable with a blank,
949 then this should be indicated by giving \fBeo\fR.
951 .SS Keypad and Function Keys
953 If the terminal has a keypad that transmits codes when the keys are pressed,
954 this information can be given.
955 Note that it is not possible to handle
956 terminals where the keypad only works in local (this applies, for example,
957 to the unshifted HP 2621 keys).
958 If the keypad can be set to transmit or not transmit,
959 give these codes as \fBsmkx\fR and \fBrmkx\fR.
960 Otherwise the keypad is assumed to always transmit.
962 The codes sent by the left arrow, right arrow, up arrow, down arrow,
963 and home keys can be given as
964 \fBkcub1, kcuf1, kcuu1, kcud1, \fRand\fB khome\fR respectively.
965 If there are function keys such as f0, f1, ..., f10, the codes they send
966 can be given as \fBkf0, kf1, ..., kf10\fR.
967 If these keys have labels other than the default f0 through f10, the labels
968 can be given as \fBlf0, lf1, ..., lf10\fR.
970 The codes transmitted by certain other special keys can be given:
982 (clear the tab stop in this column),
985 (clear screen or erase key),
997 (clear to end of line),
1000 (clear to end of screen),
1003 (insert character or enter insert mode),
1015 (scroll forward/down),
1018 (scroll backward/up),
1021 (set a tab stop in this column).
1023 In addition, if the keypad has a 3 by 3 array of keys including the four
1024 arrow keys, the other five keys can be given as
1031 These keys are useful when the effects of a 3 by 3 directional pad are needed.
1033 Strings to program function keys can be given as
1038 A string to program screen labels should be specified as \fBpln\fP.
1039 Each of these strings takes two parameters: the function key number to
1040 program (from 0 to 10) and the string to program it with.
1041 Function key numbers out of this range may program undefined keys in
1042 a terminal dependent manner.
1043 The difference between the capabilities is that
1045 causes pressing the given key to be the same as the user typing the
1048 causes the string to be executed by the terminal in local; and
1050 causes the string to be transmitted to the computer.
1052 The capabilities \fBnlab\fP, \fBlw\fP and \fBlh\fP
1053 define the number of programmable
1054 screen labels and their width and height.
1055 If there are commands to turn the labels on and off,
1056 give them in \fBsmln\fP and \fBrmln\fP.
1057 \fBsmln\fP is normally output after one or more pln
1058 sequences to make sure that the change becomes visible.
1060 .SS Tabs and Initialization
1062 If the terminal has hardware tabs, the command to advance to the next
1063 tab stop can be given as
1065 (usually control I).
1066 A \*(``back-tab\*('' command which moves leftward to the preceding tab stop can
1069 By convention, if the teletype modes indicate that tabs are being
1070 expanded by the computer rather than being sent to the terminal,
1071 programs should not use
1075 even if they are present, since the user may not have the tab stops
1077 If the terminal has hardware tabs which are initially set every
1079 spaces when the terminal is powered up,
1080 the numeric parameter
1082 is given, showing the number of spaces the tabs are set to.
1083 This is normally used by the
1085 command to determine whether to set the mode for hardware tab expansion,
1086 and whether to set the tab stops.
1087 If the terminal has tab stops that can be saved in non-volatile memory,
1088 the terminfo description can assume that they are properly set.
1096 initialization strings for the terminal,
1098 the path name of a program to be run to initialize the terminal,
1099 and \fBif\fR, the name of a file containing long initialization strings.
1100 These strings are expected to set the terminal into modes consistent
1101 with the rest of the terminfo description.
1102 They are normally sent to the terminal, by the
1106 program, each time the user logs in.
1107 They will be printed in the following order:
1117 set the margins using
1136 Most initialization is done with
1138 Special terminal modes can be set up without duplicating strings
1139 by putting the common sequences in
1141 and special cases in
1146 A set of sequences that does a harder reset from a totally unknown state
1160 These strings are output by the
1162 program, which is used when the terminal gets into a wedged state.
1163 Commands are normally placed in
1169 only if they produce annoying effects on the screen and are not
1170 necessary when logging in.
1171 For example, the command to set the vt100 into 80-column mode would
1174 but it causes an annoying glitch of the screen and is not normally
1175 needed since the terminal is usually already in 80 column mode.
1179 program writes strings
1182 etc., in the same order as the
1195 reset capability strings are missing, the
1197 program falls back upon the corresponding initialization capability string.
1199 If there are commands to set and clear tab stops, they can be given as
1201 (clear all tab stops)
1204 (set a tab stop in the current column of every row).
1205 If a more complex sequence is needed to set the tabs than can be
1206 described by this, the sequence can be placed in
1210 .SS Delays and Padding
1212 Many older and slower terminals do not support either XON/XOFF or DTR
1213 handshaking, including hard copy terminals and some very archaic CRTs
1214 (including, for example, DEC VT100s).
1215 These may require padding characters
1216 after certain cursor motions and screen changes.
1218 If the terminal uses xon/xoff handshaking for flow control (that is,
1219 it automatically emits ^S back to the host when its input buffers are
1222 This capability suppresses the emission of padding.
1224 for memory-mapped console devices effectively that do not have a speed limit.
1225 Padding information should still be included so that routines can
1226 make better decisions about relative costs, but actual pad characters will
1229 If \fBpb\fR (padding baud rate) is given, padding is suppressed at baud rates
1230 below the value of \fBpb\fR.
1231 If the entry has no padding baud rate, then
1232 whether padding is emitted or not is completely controlled by \fBxon\fR.
1234 If the terminal requires other than a null (zero) character as a pad,
1235 then this can be given as \fBpad\fR.
1236 Only the first character of the
1241 Some terminals have an extra `status line' which is not normally used by
1242 software (and thus not counted in the terminal's \fBlines\fR capability).
1244 The simplest case is a status line which is cursor-addressable but not
1245 part of the main scrolling region on the screen; the Heathkit H19 has
1246 a status line of this kind, as would a 24-line VT100 with a 23-line
1247 scrolling region set up on initialization.
1248 This situation is indicated
1249 by the \fBhs\fR capability.
1251 Some terminals with status lines need special sequences to access the
1253 These may be expressed as a string with single parameter
1254 \fBtsl\fR which takes the cursor to a given zero-origin column on the
1256 The capability \fBfsl\fR must return to the main-screen
1257 cursor positions before the last \fBtsl\fR.
1258 You may need to embed the
1259 string values of \fBsc\fR (save cursor) and \fBrc\fR (restore cursor)
1260 in \fBtsl\fR and \fBfsl\fR to accomplish this.
1262 The status line is normally assumed to be the same width as the width
1264 If this is untrue, you can specify it with the numeric
1265 capability \fBwsl\fR.
1267 A command to erase or blank the status line may be specified as \fBdsl\fR.
1269 The boolean capability \fBeslok\fR specifies that escape sequences, tabs,
1270 etc., work ordinarily in the status line.
1272 The \fBncurses\fR implementation does not yet use any of these capabilities.
1273 They are documented here in case they ever become important.
1277 Many terminals have alternate character sets useful for forms-drawing.
1278 Terminfo and \fBcurses\fR build in support for the drawing characters
1279 supported by the VT100, with some characters from the AT&T 4410v1 added.
1280 This alternate character set may be specified by the \fBacsc\fR capability.
1288 \fBGlyph ACS Ascii VT100\fR
1289 \fBName Name Default Name\fR
1290 UK pound sign ACS_STERLING f }
1291 arrow pointing down ACS_DARROW v .
1292 arrow pointing left ACS_LARROW < ,
1293 arrow pointing right ACS_RARROW > +
1294 arrow pointing up ACS_UARROW ^ \-
1295 board of squares ACS_BOARD # h
1296 bullet ACS_BULLET o ~
1297 checker board (stipple) ACS_CKBOARD : a
1298 degree symbol ACS_DEGREE \e f
1299 diamond ACS_DIAMOND + `
1300 greater-than-or-equal-to ACS_GEQUAL > z
1302 horizontal line ACS_HLINE \- q
1303 lantern symbol ACS_LANTERN # i
1304 large plus or crossover ACS_PLUS + n
1305 less-than-or-equal-to ACS_LEQUAL < y
1306 lower left corner ACS_LLCORNER + m
1307 lower right corner ACS_LRCORNER + j
1308 not-equal ACS_NEQUAL ! |
1309 plus/minus ACS_PLMINUS # g
1310 scan line 1 ACS_S1 ~ o
1311 scan line 3 ACS_S3 \- p
1312 scan line 7 ACS_S7 \- r
1313 scan line 9 ACS_S9 \&_ s
1314 solid square block ACS_BLOCK # 0
1315 tee pointing down ACS_TTEE + w
1316 tee pointing left ACS_RTEE + u
1317 tee pointing right ACS_LTEE + t
1318 tee pointing up ACS_BTEE + v
1319 upper left corner ACS_ULCORNER + l
1320 upper right corner ACS_URCORNER + k
1321 vertical line ACS_VLINE | x
1324 The best way to define a new device's graphics set is to add a column
1325 to a copy of this table for your terminal, giving the character which
1326 (when emitted between \fBsmacs\fR/\fBrmacs\fR switches) will be rendered
1327 as the corresponding graphic.
1328 Then read off the VT100/your terminal
1329 character pairs right to left in sequence; these become the ACSC string.
1333 Most color terminals are either `Tektronix-like' or `HP-like'.
1335 terminals have a predefined set of N colors (where N usually 8), and can set
1336 character-cell foreground and background characters independently, mixing them
1337 into N\ *\ N color-pairs.
1338 On HP-like terminals, the use must set each color
1339 pair up separately (foreground and background are not independently settable).
1340 Up to M color-pairs may be set up from 2*M different colors.
1342 terminals are Tektronix-like.
1344 Some basic color capabilities are independent of the color method.
1346 capabilities \fBcolors\fR and \fBpairs\fR specify the maximum numbers of colors
1347 and color-pairs that can be displayed simultaneously.
1348 The \fBop\fR (original
1349 pair) string resets foreground and background colors to their default values
1351 The \fBoc\fR string resets all colors or color-pairs to
1352 their default values for the terminal.
1353 Some terminals (including many PC
1354 terminal emulators) erase screen areas with the current background color rather
1355 than the power-up default background; these should have the boolean capability
1358 To change the current foreground or background color on a Tektronix-type
1359 terminal, use \fBsetaf\fR (set ANSI foreground) and \fBsetab\fR (set ANSI
1360 background) or \fBsetf\fR (set foreground) and \fBsetb\fR (set background).
1361 These take one parameter, the color number.
1362 The SVr4 documentation describes
1363 only \fBsetaf\fR/\fBsetab\fR; the XPG4 draft says that "If the terminal
1364 supports ANSI escape sequences to set background and foreground, they should
1365 be coded as \fBsetaf\fR and \fBsetab\fR, respectively.
1367 supports other escape sequences to set background and foreground, they should
1368 be coded as \fBsetf\fR and \fBsetb\fR, respectively.
1370 function and the refresh functions use \fBsetaf\fR and \fBsetab\fR if they are
1373 The \fBsetaf\fR/\fBsetab\fR and \fBsetf\fR/\fBsetb\fR capabilities take a
1374 single numeric argument each.
1375 Argument values 0-7 of \fBsetaf\fR/\fBsetab\fR are portably defined as
1376 follows (the middle column is the symbolic #define available in the header for
1377 the \fBcurses\fR or \fBncurses\fR libraries).
1378 The terminal hardware is free to
1379 map these as it likes, but the RGB values indicate normal locations in color
1386 \fBColor #define Value RGB\fR
1387 black \fBCOLOR_BLACK\fR 0 0, 0, 0
1388 red \fBCOLOR_RED\ \fR 1 max,0,0
1389 green \fBCOLOR_GREEN\fR 2 0,max,0
1390 yellow \fBCOLOR_YELLOW\fR 3 max,max,0
1391 blue \fBCOLOR_BLUE\fR 4 0,0,max
1392 magenta \fBCOLOR_MAGENTA\fR 5 max,0,max
1393 cyan \fBCOLOR_CYAN\fR 6 0,max,max
1394 white \fBCOLOR_WHITE\fR 7 max,max,max
1397 The argument values of \fBsetf\fR/\fBsetb\fR historically correspond to
1398 a different mapping, i.e.,
1403 \fBColor #define Value RGB\fR
1404 black \fBCOLOR_BLACK\fR 0 0, 0, 0
1405 blue \fBCOLOR_BLUE\fR 1 0,0,max
1406 green \fBCOLOR_GREEN\fR 2 0,max,0
1407 cyan \fBCOLOR_CYAN\fR 3 0,max,max
1408 red \fBCOLOR_RED\ \fR 4 max,0,0
1409 magenta \fBCOLOR_MAGENTA\fR 5 max,0,max
1410 yellow \fBCOLOR_YELLOW\fR 6 max,max,0
1411 white \fBCOLOR_WHITE\fR 7 max,max,max
1414 It is important to not confuse the two sets of color capabilities;
1415 otherwise red/blue will be interchanged on the display.
1417 On an HP-like terminal, use \fBscp\fR with a color-pair number parameter to set
1418 which color pair is current.
1420 On a Tektronix-like terminal, the capability \fBccc\fR may be present to
1421 indicate that colors can be modified.
1422 If so, the \fBinitc\fR capability will
1423 take a color number (0 to \fBcolors\fR \- 1)and three more parameters which
1425 These three parameters default to being interpreted as RGB
1426 (Red, Green, Blue) values.
1427 If the boolean capability \fBhls\fR is present,
1428 they are instead as HLS (Hue, Lightness, Saturation) indices.
1432 On an HP-like terminal, \fBinitp\fR may give a capability for changing a
1434 It will take seven parameters; a color-pair number (0 to
1435 \fBmax_pairs\fR \- 1), and two triples describing first background and then
1437 These parameters must be (Red, Green, Blue) or
1438 (Hue, Lightness, Saturation) depending on \fBhls\fR.
1440 On some color terminals, colors collide with highlights.
1442 these collisions with the \fBncv\fR capability.
1443 This is a bit-mask of
1444 attributes not to be used when colors are enabled.
1445 The correspondence with the
1446 attributes understood by \fBcurses\fR is as follows:
1452 \fBAttribute Bit Decimal Set by\fR
1461 A_ALTCHARSET 8 256 sgr
1462 A_HORIZONTAL 9 512 sgr1
1465 A_RIGHT 12 4096 sgr1
1467 A_VERTICAL 14 16384 sgr1
1468 A_ITALIC 15 32768 sitm
1471 For example, on many IBM PC consoles, the underline attribute collides with the
1472 foreground color blue and is not available in color mode.
1474 an \fBncv\fR capability of 2.
1476 SVr4 curses does nothing with \fBncv\fR, ncurses recognizes it and optimizes
1477 the output in favor of colors.
1480 If the terminal requires other than a null (zero) character as a pad, then this
1481 can be given as pad.
1482 Only the first character of the pad string is used.
1483 If the terminal does not have a pad character, specify npc.
1484 Note that ncurses implements the termcap-compatible \fBPC\fR variable;
1485 though the application may set this value to something other than
1486 a null, ncurses will test \fBnpc\fR first and use napms if the terminal
1487 has no pad character.
1489 If the terminal can move up or down half a line,
1490 this can be indicated with
1496 This is primarily useful for superscripts and subscripts on hard-copy terminals.
1497 If a hard-copy terminal can eject to the next page (form feed), give this as
1499 (usually control L).
1501 If there is a command to repeat a given character a given number of
1502 times (to save time transmitting a large number of identical characters)
1503 this can be indicated with the parameterized string
1505 The first parameter is the character to be repeated and the second
1506 is the number of times to repeat it.
1507 Thus, tparm(repeat_char, 'x', 10) is the same as `xxxxxxxxxx'.
1509 If the terminal has a settable command character, such as the \s-1TEKTRONIX\s+1 4025,
1510 this can be indicated with
1512 A prototype command character is chosen which is used in all capabilities.
1513 This character is given in the
1515 capability to identify it.
1516 The following convention is supported on some UNIX systems:
1517 The environment is to be searched for a
1519 variable, and if found, all
1520 occurrences of the prototype character are replaced with the character
1521 in the environment variable.
1523 Terminal descriptions that do not represent a specific kind of known
1532 (generic) capability so that programs can complain that they do not know
1533 how to talk to the terminal.
1534 (This capability does not apply to
1536 terminal descriptions for which the escape sequences are known.)
1538 If the terminal has a \*(``meta key\*('' which acts as a shift key,
1539 setting the 8th bit of any character transmitted, this fact can
1542 Otherwise, software will assume that the 8th bit is parity and it
1543 will usually be cleared.
1544 If strings exist to turn this \*(``meta mode\*('' on and off, they
1550 If the terminal has more lines of memory than will fit on the screen
1551 at once, the number of lines of memory can be indicated with
1555 indicates that the number of lines is not fixed,
1556 but that there is still more memory than fits on the screen.
1558 If the terminal is one of those supported by the \s-1UNIX\s+1 virtual
1559 terminal protocol, the terminal number can be given as
1563 strings which control an auxiliary printer connected to the terminal
1566 print the contents of the screen,
1568 turn off the printer, and
1570 turn on the printer.
1571 When the printer is on, all text sent to the terminal will be sent
1573 It is undefined whether the text is also displayed on the terminal screen
1574 when the printer is on.
1577 takes one parameter, and leaves the printer on for as many characters
1578 as the value of the parameter, then turns the printer off.
1579 The parameter should not exceed 255.
1582 is transparently passed to the printer while an
1586 .SS Glitches and Braindamage
1588 Hazeltine terminals, which do not allow `~' characters to be displayed should
1591 Terminals which ignore a line-feed immediately after an \fBam\fR wrap,
1592 such as the Concept and vt100,
1593 should indicate \fBxenl\fR.
1597 is required to get rid of standout
1598 (instead of merely writing normal text on top of it),
1599 \fBxhp\fP should be given.
1601 Teleray terminals, where tabs turn all characters moved over to blanks,
1602 should indicate \fBxt\fR (destructive tabs).
1603 Note: the variable indicating this is now `dest_tabs_magic_smso'; in
1604 older versions, it was teleray_glitch.
1605 This glitch is also taken to mean that it is not possible to position
1606 the cursor on top of a \*(``magic cookie\*('',
1607 that to erase standout mode it is instead necessary to use
1608 delete and insert line.
1609 The ncurses implementation ignores this glitch.
1611 The Beehive Superbee, which is unable to correctly transmit the escape
1612 or control C characters, has
1614 indicating that the f1 key is used for escape and f2 for control C.
1615 (Only certain Superbees have this problem, depending on the ROM.)
1616 Note that in older terminfo versions, this capability was called
1617 `beehive_glitch'; it is now `no_esc_ctl_c'.
1619 Other specific terminal problems may be corrected by adding more
1620 capabilities of the form \fBx\fR\fIx\fR.
1622 .SS Similar Terminals
1624 If there are two very similar terminals, one (the variant) can be defined as
1625 being just like the other (the base) with certain exceptions.
1627 definition of the variant, the string capability \fBuse\fR can be given with
1628 the name of the base terminal.
1629 The capabilities given before
1631 override those in the base type named by
1633 If there are multiple \fBuse\fR capabilities, they are merged in reverse order.
1634 That is, the rightmost \fBuse\fR reference is processed first, then the one to
1635 its left, and so forth.
1636 Capabilities given explicitly in the entry override
1637 those brought in by \fBuse\fR references.
1639 A capability can be canceled by placing \fBxx@\fR to the left of the
1640 use reference that imports it, where \fIxx\fP is the capability.
1641 For example, the entry
1644 2621\-nl, smkx@, rmkx@, use=2621,
1647 defines a 2621\-nl that does not have the \fBsmkx\fR or \fBrmkx\fR capabilities,
1648 and hence does not turn on the function key labels when in visual mode.
1649 This is useful for different modes for a terminal, or for different
1652 .SS Pitfalls of Long Entries
1654 Long terminfo entries are unlikely to be a problem; to date, no entry has even
1655 approached terminfo's 4096-byte string-table maximum.
1656 Unfortunately, the termcap
1657 translations are much more strictly limited (to 1023 bytes), thus termcap translations
1658 of long terminfo entries can cause problems.
1660 The man pages for 4.3BSD and older versions of \fBtgetent()\fP instruct the user to
1661 allocate a 1024-byte buffer for the termcap entry.
1662 The entry gets null-terminated by
1663 the termcap library, so that makes the maximum safe length for a termcap entry
1665 Depending on what the application and the termcap library
1666 being used does, and where in the termcap file the terminal type that \fBtgetent()\fP
1667 is searching for is, several bad things can happen.
1669 Some termcap libraries print a warning message or exit if they find an
1670 entry that's longer than 1023 bytes; others do not; others truncate the
1671 entries to 1023 bytes.
1672 Some application programs allocate more than
1673 the recommended 1K for the termcap entry; others do not.
1675 Each termcap entry has two important sizes associated with it: before
1676 "tc" expansion, and after "tc" expansion.
1677 "tc" is the capability that
1678 tacks on another termcap entry to the end of the current one, to add
1679 on its capabilities.
1680 If a termcap entry does not use the "tc"
1681 capability, then of course the two lengths are the same.
1683 The "before tc expansion" length is the most important one, because it
1684 affects more than just users of that particular terminal.
1686 length of the entry as it exists in /etc/termcap, minus the
1687 backslash-newline pairs, which \fBtgetent()\fP strips out while reading it.
1688 Some termcap libraries strip off the final newline, too (GNU termcap does not).
1691 a termcap entry before expansion is more than 1023 bytes long,
1693 and the application has only allocated a 1k buffer,
1695 and the termcap library (like the one in BSD/OS 1.1 and GNU) reads
1696 the whole entry into the buffer, no matter what its length, to see
1697 if it is the entry it wants,
1699 and \fBtgetent()\fP is searching for a terminal type that either is the
1700 long entry, appears in the termcap file after the long entry, or
1701 does not appear in the file at all (so that \fBtgetent()\fP has to search
1702 the whole termcap file).
1704 Then \fBtgetent()\fP will overwrite memory, perhaps its stack, and probably core dump
1706 Programs like telnet are particularly vulnerable; modern telnets
1707 pass along values like the terminal type automatically.
1708 The results are almost
1709 as undesirable with a termcap library, like SunOS 4.1.3 and Ultrix 4.4, that
1710 prints warning messages when it reads an overly long termcap entry.
1712 termcap library truncates long entries, like OSF/1 3.0, it is immune to dying
1713 here but will return incorrect data for the terminal.
1715 The "after tc expansion" length will have a similar effect to the
1716 above, but only for people who actually set TERM to that terminal
1717 type, since \fBtgetent()\fP only does "tc" expansion once it is found the
1718 terminal type it was looking for, not while searching.
1720 In summary, a termcap entry that is longer than 1023 bytes can cause,
1721 on various combinations of termcap libraries and applications, a core
1722 dump, warnings, or incorrect operation.
1723 If it is too long even before
1724 "tc" expansion, it will have this effect even for users of some other
1725 terminal types and users whose TERM variable does not have a termcap
1728 When in \-C (translate to termcap) mode, the \fBncurses\fR implementation of
1729 \fB@TIC@\fR(1M) issues warning messages when the pre-tc length of a termcap
1730 translation is too long.
1731 The \-c (check) option also checks resolved (after tc
1733 .SS Binary Compatibility
1734 It is not wise to count on portability of binary terminfo entries between
1735 commercial UNIX versions.
1736 The problem is that there are at least two versions
1737 of terminfo (under HP\-UX and AIX) which diverged from System V terminfo after
1738 SVr1, and have added extension capabilities to the string table that (in the
1739 binary format) collide with System V and XSI Curses extensions.
1742 Searching for terminal descriptions in
1743 \fB$HOME/.terminfo\fR and TERMINFO_DIRS
1744 is not supported by older implementations.
1746 Some SVr4 \fBcurses\fR implementations, and all previous to SVr4, do not
1747 interpret the %A and %O operators in parameter strings.
1749 SVr4/XPG4 do not specify whether \fBmsgr\fR licenses movement while in
1750 an alternate-character-set mode (such modes may, among other things, map
1751 CR and NL to characters that do not trigger local motions).
1752 The \fBncurses\fR implementation ignores \fBmsgr\fR in \fBALTCHARSET\fR
1754 This raises the possibility that an XPG4
1755 implementation making the opposite interpretation may need terminfo
1756 entries made for \fBncurses\fR to have \fBmsgr\fR turned off.
1758 The \fBncurses\fR library handles insert-character and insert-character modes
1759 in a slightly non-standard way to get better update efficiency.
1761 the \fBInsert/Delete Character\fR subsection above.
1763 The parameter substitutions for \fBset_clock\fR and \fBdisplay_clock\fR are
1764 not documented in SVr4 or the XSI Curses standard.
1765 They are deduced from the
1766 documentation for the AT&T 505 terminal.
1768 Be careful assigning the \fBkmous\fR capability.
1769 The \fBncurses\fR wants to
1770 interpret it as \fBKEY_MOUSE\fR, for use by terminals and emulators like xterm
1771 that can return mouse-tracking information in the keyboard-input stream.
1773 X/Open Curses does not mention italics.
1774 Portable applications must assume that numeric capabilities are
1775 signed 16-bit values.
1776 This includes the \fIno_color_video\fP (ncv) capability.
1777 The 32768 mask value used for italics with ncv can be confused with
1778 an absent or cancelled ncv.
1779 If italics should work with colors,
1780 then the ncv value must be specified, even if it is zero.
1782 Different commercial ports of terminfo and curses support different subsets of
1783 the XSI Curses standard and (in some cases) different extension sets.
1785 is a summary, accurate as of October 1995:
1787 \fBSVR4, Solaris, ncurses\fR \-\-
1788 These support all SVr4 capabilities.
1791 Supports the SVr4 set, adds one undocumented extended string
1792 capability (\fBset_pglen\fR).
1794 \fBSVr1, Ultrix\fR \-\-
1795 These support a restricted subset of terminfo capabilities.
1796 The booleans end with \fBxon_xoff\fR;
1797 the numerics with \fBwidth_status_line\fR;
1798 and the strings with \fBprtr_non\fR.
1801 Supports the SVr1 subset, plus the SVr[234] numerics \fBnum_labels\fR,
1802 \fBlabel_height\fR, \fBlabel_width\fR, plus function keys 11 through 63, plus
1803 \fBplab_norm\fR, \fBlabel_on\fR, and \fBlabel_off\fR, plus some incompatible
1804 extensions in the string table.
1807 Supports the SVr1 subset, plus function keys 11 through 63, plus a number
1808 of incompatible string table extensions.
1811 Supports both the SVr4 set and the AIX extensions.
1815 files containing terminal descriptions
1818 \fB@INFOCMP@\fR(1M),
1822 \fBterm_variables\fR(3X).
1824 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
1825 Based on pcurses by Pavel Curtis.