X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=doc%2Fhtml%2Fman%2Fterminfo.5.html;h=5d128260bdab4cfaa8b0a63f876e33e4f22107ab;hp=09ba56ca2c8409dd32814b42de8ad6a427d61ae0;hb=51a395aaa20e4aa687310bb8cb1616ccf8e8fd0d;hpb=eed52798fc41bc59e199e3a056adec8627b75423;ds=sidebyside diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html index 09ba56ca..5d128260 100644 --- a/doc/html/man/terminfo.5.html +++ b/doc/html/man/terminfo.5.html @@ -33,7 +33,7 @@ **************************************************************************** * @Id: terminfo.head,v 1.35 2018/07/28 22:29:09 tom Exp @ * Head of terminfo man page ends here - * @Id: terminfo.tail,v 1.90 2019/01/20 20:21:46 tom Exp @ + * @Id: terminfo.tail,v 1.93 2019/06/01 22:32:15 tom Exp @ * Beginning of terminfo.tail file * This file is part of ncurses. * See "terminfo.head" for copyright. @@ -74,7 +74,7 @@ Terminfo describes terminals by giving a set of capabilities which they have, by specifying how to perform screen operations, and by specifying padding requirements and initialization sequences. This describes - ncurses version 6.1 (patch 20190518). + ncurses version 6.1 (patch 20190615).
@@ -1326,7 +1326,7 @@ applies to storage scope terminals, such as TEKTRONIX 4010 series, as well as hard copy and APL terminals.) If there is a code to move the cursor to the left edge of the current row, give this as cr. (Normally - this will be carriage return, control M.) If there is a code to pro- + this will be carriage return, control/M.) If there is a code to pro- duce an audible signal (bell, beep, etc) give this as bel. If there is a code to move the cursor one position to the left (such as @@ -1862,29 +1862,42 @@
- If the terminal has hardware tabs, the command to advance to the next - tab stop can be given as ht (usually control I). A "back-tab" command - which moves leftward to the preceding tab stop can be given as cbt. By - convention, if the teletype modes indicate that tabs are being expanded - by the computer rather than being sent to the terminal, programs should - not use ht or cbt even if they are present, since the user may not have - the tab stops properly set. If the terminal has hardware tabs which - are initially set every n spaces when the terminal is powered up, the - numeric parameter it is given, showing the number of spaces the tabs - are set to. This is normally used by the tset command to determine - whether to set the mode for hardware tab expansion, and whether to set - the tab stops. If the terminal has tab stops that can be saved in non- - volatile memory, the terminfo description can assume that they are - properly set. - - Other capabilities include is1, is2, and is3, initialization strings - for the terminal, iprog, the path name of a program to be run to ini- - tialize the terminal, and if, the name of a file containing long ini- - tialization strings. These strings are expected to set the terminal - into modes consistent with the rest of the terminfo description. They - are normally sent to the terminal, by the init option of the tput pro- - gram, each time the user logs in. They will be printed in the follow- - ing order: + A few capabilities are used only for tabs: + + o If the terminal has hardware tabs, the command to advance to the + next tab stop can be given as ht (usually control/I). + + o A "back-tab" command which moves leftward to the preceding tab stop + can be given as cbt. + + By convention, if the teletype modes indicate that tabs are being + expanded by the computer rather than being sent to the terminal, + programs should not use ht or cbt even if they are present, since + the user may not have the tab stops properly set. + + o If the terminal has hardware tabs which are initially set every n + spaces when the terminal is powered up, the numeric parameter it is + given, showing the number of spaces the tabs are set to. + + The it capability is normally used by the tset command to determine + whether to set the mode for hardware tab expansion, and whether to + set the tab stops. If the terminal has tab stops that can be saved + in non-volatile memory, the terminfo description can assume that + they are properly set. + + Other capabilities include + + o is1, is2, and is3, initialization strings for the terminal, + + o iprog, the path name of a program to be run to initialize the ter- + minal, + + o and if, the name of a file containing long initialization strings. + + These strings are expected to set the terminal into modes consistent + with the rest of the terminfo description. They are normally sent to + the terminal, by the init option of the tput program, each time the + user logs in. They will be printed in the following order: run the program iprog @@ -1903,92 +1916,114 @@ and finally output is3. - Most initialization is done with is2. Special terminal modes can be - set up without duplicating strings by putting the common sequences in + Most initialization is done with is2. Special terminal modes can be + set up without duplicating strings by putting the common sequences in is2 and special cases in is1 and is3. - A set of sequences that does a harder reset from a totally unknown + A set of sequences that does a harder reset from a totally unknown state can be given as rs1, rs2, rf and rs3, analogous to is1 , is2 , if - and is3 respectively. These strings are output by the reset program, - which is used when the terminal gets into a wedged state. Commands are - normally placed in rs1, rs2 rs3 and rf only if they produce annoying - effects on the screen and are not necessary when logging in. For exam- - ple, the command to set the vt100 into 80-column mode would normally be - part of is2, but it causes an annoying glitch of the screen and is not - normally needed since the terminal is usually already in 80 column - mode. - - The reset program writes strings including iprog, etc., in the same - order as the init program, using rs1, etc., instead of is1, etc. If - any of rs1, rs2, rs3, or rf reset capability strings are missing, the + and is3 respectively. These strings are output by the reset program + (an alias of tset), which is used when the terminal gets into a wedged + state. Commands are normally placed in rs1, rs2 rs3 and rf only if + they produce annoying effects on the screen and are not necessary when + logging in. For example, the command to set the vt100 into 80-column + mode would normally be part of is2, but it causes an annoying glitch of + the screen and is not normally needed since the terminal is usually + already in 80 column mode. + + The reset program writes strings including iprog, etc., in the same + order as the init program, using rs1, etc., instead of is1, etc. If + any of rs1, rs2, rs3, or rf reset capability strings are missing, the reset program falls back upon the corresponding initialization capabil- ity string. - If there are commands to set and clear tab stops, they can be given as + If there are commands to set and clear tab stops, they can be given as tbc (clear all tab stops) and hts (set a tab stop in the current column - of every row). If a more complex sequence is needed to set the tabs + of every row). If a more complex sequence is needed to set the tabs than can be described by this, the sequence can be placed in is2 or if. + The tput reset command uses the same capability strings as the reset + command, although the two programs (tput and reset) provide different + command-line options. + + In practice, these terminfo capabilities are not often used in initial- + ization of tabs (though they are required for the tabs program): + + o Almost all hardware terminals (at least those which supported tabs) + initialized those to every eight columns: + + The only exception was the AT&T 2300 series, which set tabs to + every five columns. + + o In particular, developers of the hardware terminals which are com- + monly used as models for modern terminal emulators provided docu- + mentation demonstrating that eight columns were the standard. + + o Because of this, the terminal initialization programs tput and tset + use the tbc (clear_all_tabs) and hts (set_tab) capabilities + directly only when the it (init_tabs) capability is set to a value + other than eight. +
- Many older and slower terminals do not support either XON/XOFF or DTR - handshaking, including hard copy terminals and some very archaic CRTs - (including, for example, DEC VT100s). These may require padding char- + Many older and slower terminals do not support either XON/XOFF or DTR + handshaking, including hard copy terminals and some very archaic CRTs + (including, for example, DEC VT100s). These may require padding char- acters after certain cursor motions and screen changes. If the terminal uses xon/xoff handshaking for flow control (that is, it - automatically emits ^S back to the host when its input buffers are - close to full), set xon. This capability suppresses the emission of - padding. You can also set it for memory-mapped console devices effec- - tively that do not have a speed limit. Padding information should + automatically emits ^S back to the host when its input buffers are + close to full), set xon. This capability suppresses the emission of + padding. You can also set it for memory-mapped console devices effec- + tively that do not have a speed limit. Padding information should still be included so that routines can make better decisions about rel- ative costs, but actual pad characters will not be transmitted. If pb (padding baud rate) is given, padding is suppressed at baud rates - below the value of pb. If the entry has no padding baud rate, then + below the value of pb. If the entry has no padding baud rate, then whether padding is emitted or not is completely controlled by xon. - If the terminal requires other than a null (zero) character as a pad, - then this can be given as pad. Only the first character of the pad + If the terminal requires other than a null (zero) character as a pad, + then this can be given as pad. Only the first character of the pad string is used.
- Some terminals have an extra "status line" which is not normally used + Some terminals have an extra "status line" which is not normally used by software (and thus not counted in the terminal's lines capability). - The simplest case is a status line which is cursor-addressable but not + The simplest case is a status line which is cursor-addressable but not part of the main scrolling region on the screen; the Heathkit H19 has a - status line of this kind, as would a 24-line VT100 with a 23-line + status line of this kind, as would a 24-line VT100 with a 23-line scrolling region set up on initialization. This situation is indicated by the hs capability. - Some terminals with status lines need special sequences to access the - status line. These may be expressed as a string with single parameter - tsl which takes the cursor to a given zero-origin column on the status - line. The capability fsl must return to the main-screen cursor posi- - tions before the last tsl. You may need to embed the string values of - sc (save cursor) and rc (restore cursor) in tsl and fsl to accomplish + Some terminals with status lines need special sequences to access the + status line. These may be expressed as a string with single parameter + tsl which takes the cursor to a given zero-origin column on the status + line. The capability fsl must return to the main-screen cursor posi- + tions before the last tsl. You may need to embed the string values of + sc (save cursor) and rc (restore cursor) in tsl and fsl to accomplish this. - The status line is normally assumed to be the same width as the width - of the terminal. If this is untrue, you can specify it with the + The status line is normally assumed to be the same width as the width + of the terminal. If this is untrue, you can specify it with the numeric capability wsl. A command to erase or blank the status line may be specified as dsl. - The boolean capability eslok specifies that escape sequences, tabs, + The boolean capability eslok specifies that escape sequences, tabs, etc., work ordinarily in the status line. - The ncurses implementation does not yet use any of these capabilities. + The ncurses implementation does not yet use any of these capabilities. They are documented here in case they ever become important.
- Many terminals have alternate character sets useful for forms-drawing. + Many terminals have alternate character sets useful for forms-drawing. Terminfo and curses have built-in support for most of the drawing char- - acters supported by the VT100, with some characters from the AT&T - 4410v1 added. This alternate character set may be specified by the + acters supported by the VT100, with some characters from the AT&T + 4410v1 added. This alternate character set may be specified by the acsc capability. Glyph ACS Ascii acsc acsc @@ -2004,7 +2039,6 @@ degree symbol ACS_DEGREE \ f 0x66 plus/minus ACS_PLMINUS # g 0x67 board of squares ACS_BOARD # h 0x68 - lantern symbol ACS_LANTERN # i 0x69 lower right corner ACS_LRCORNER + j 0x6a upper right corner ACS_URCORNER + k 0x6b @@ -2030,34 +2064,34 @@ A few notes apply to the table itself: - o X/Open Curses incorrectly states that the mapping for lantern is - uppercase "I" although Unix implementations use the lowercase "i" + o X/Open Curses incorrectly states that the mapping for lantern is + uppercase "I" although Unix implementations use the lowercase "i" mapping. - o The DEC VT100 implemented graphics using the alternate character - set feature, temporarily switching modes and sending characters in + o The DEC VT100 implemented graphics using the alternate character + set feature, temporarily switching modes and sending characters in the range 0x60 (96) to 0x7e (126) (the acsc Value column in the ta- ble). o The AT&T terminal added graphics characters outside that range. - Some of the characters within the range do not match the VT100; - presumably they were used in the AT&T terminal: board of squares - replaces the VT100 newline symbol, while lantern symbol replaces + Some of the characters within the range do not match the VT100; + presumably they were used in the AT&T terminal: board of squares + replaces the VT100 newline symbol, while lantern symbol replaces the VT100 vertical tab symbol. The other VT100 symbols for control - characters (horizontal tab, carriage return and line-feed) are not + characters (horizontal tab, carriage return and line-feed) are not (re)used in curses. - 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 + 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.
- The curses library functions init_pair and init_color manipulate the - color pairs and color values discussed in this section (see + The curses library functions init_pair and init_color manipulate the + color pairs and color values discussed in this section (see curs_color(3x) for details on these and related functions). Most color terminals are either "Tektronix-like" or "HP-like": @@ -2066,43 +2100,43 @@ is usually 8), and can set character-cell foreground and background characters independently, mixing them into N * N color-pairs. - o On HP-like terminals, the user must set each color pair up sepa- - rately (foreground and background are not independently settable). + o On HP-like terminals, the user must set each color pair up sepa- + rately (foreground and background are not independently settable). Up to M color-pairs may be set up from 2*M different colors. ANSI- compatible terminals are Tektronix-like. Some basic color capabilities are independent of the color method. The - numeric capabilities colors and pairs specify the maximum numbers of - colors and color-pairs that can be displayed simultaneously. The op + numeric capabilities colors and pairs specify the maximum numbers of + colors and color-pairs that can be displayed simultaneously. The op (original pair) string resets foreground and background colors to their - default values for the terminal. The oc string resets all colors or - color-pairs to their default values for the terminal. Some terminals + default values for the terminal. The oc string resets all colors or + color-pairs to their default values for the terminal. Some terminals (including many PC terminal emulators) erase screen areas with the cur- - rent background color rather than the power-up default background; + rent background color rather than the power-up default background; these should have the boolean capability bce. While the curses library works with color pairs (reflecting the inabil- - ity of some devices to set foreground and background colors indepen- + ity of some devices to set foreground and background colors indepen- dently), there are separate capabilities for setting these features: - o To change the current foreground or background color on a Tek- - tronix-type terminal, use setaf (set ANSI foreground) and setab - (set ANSI background) or setf (set foreground) and setb (set back- - ground). These take one parameter, the color number. The SVr4 - documentation describes only setaf/setab; the XPG4 draft says that - "If the terminal supports ANSI escape sequences to set background - and foreground, they should be coded as setaf and setab, respec- + o To change the current foreground or background color on a Tek- + tronix-type terminal, use setaf (set ANSI foreground) and setab + (set ANSI background) or setf (set foreground) and setb (set back- + ground). These take one parameter, the color number. The SVr4 + documentation describes only setaf/setab; the XPG4 draft says that + "If the terminal supports ANSI escape sequences to set background + and foreground, they should be coded as setaf and setab, respec- tively. - o If the terminal supports other escape sequences to set background - and foreground, they should be coded as setf and setb, respec- - tively. The vidputs and the refresh(3x) functions use the setaf + o If the terminal supports other escape sequences to set background + and foreground, they should be coded as setf and setb, respec- + tively. The vidputs and the refresh(3x) functions use the setaf and setab capabilities if they are defined. - The setaf/setab and setf/setb capabilities take a single numeric argu- - ment each. Argument values 0-7 of setaf/setab are portably defined as - follows (the middle column is the symbolic #define available in the - header for the curses or ncurses libraries). The terminal hardware is + The setaf/setab and setf/setb capabilities take a single numeric argu- + ment each. Argument values 0-7 of setaf/setab are portably defined as + follows (the middle column is the symbolic #define available in the + header for the curses or ncurses libraries). The terminal hardware is free to map these as it likes, but the RGB values indicate normal loca- tions in color space. @@ -2112,6 +2146,7 @@ green COLOR_GREEN 2 0,max,0 yellow COLOR_YELLOW 3 max,max,0 blue COLOR_BLUE 4 0,0,max + magenta COLOR_MAGENTA 5 max,0,max cyan COLOR_CYAN 6 0,max,max white COLOR_WHITE 7 max,max,max @@ -2132,28 +2167,28 @@ It is important to not confuse the two sets of color capabilities; oth- erwise red/blue will be interchanged on the display. - On an HP-like terminal, use scp with a color-pair number parameter to + On an HP-like terminal, use scp with a color-pair number parameter to set which color pair is current. Some terminals allow the color values to be modified: - o On a Tektronix-like terminal, the capability ccc may be present to - indicate that colors can be modified. If so, the initc capability + o On a Tektronix-like terminal, the capability ccc may be present to + indicate that colors can be modified. If so, the initc capability will take a color number (0 to colors - 1)and three more parameters - which describe the color. These three parameters default to being + which describe the color. These three parameters default to being interpreted as RGB (Red, Green, Blue) values. If the boolean capa- - bility hls is present, they are instead as HLS (Hue, Lightness, + bility hls is present, they are instead as HLS (Hue, Lightness, Saturation) indices. The ranges are terminal-dependent. - o On an HP-like terminal, initp may give a capability for changing a + o On an HP-like terminal, initp may give a capability for changing a color-pair value. It will take seven parameters; a color-pair num- - ber (0 to max_pairs - 1), and two triples describing first back- - ground and then foreground colors. These parameters must be (Red, + ber (0 to max_pairs - 1), and two triples describing first back- + ground and then foreground colors. These parameters must be (Red, Green, Blue) or (Hue, Lightness, Saturation) depending on hls. - On some color terminals, colors collide with highlights. You can reg- - ister these collisions with the ncv capability. This is a bit-mask of - attributes not to be used when colors are enabled. The correspondence + On some color terminals, colors collide with highlights. You can reg- + ister these collisions with the ncv capability. This is a bit-mask of + attributes not to be used when colors are enabled. The correspondence with the attributes understood by curses is as follows: Attribute Bit Decimal Set by @@ -2174,134 +2209,134 @@ A_VERTICAL 14 16384 sgr1 A_ITALIC 15 32768 sitm - For example, on many IBM PC consoles, the underline attribute collides - with the foreground color blue and is not available in color mode. + 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. - SVr4 curses does nothing with ncv, ncurses recognizes it and optimizes + SVr4 curses does nothing with ncv, ncurses recognizes it and optimizes the output in favor of colors.
- If the terminal requires other than a null (zero) character as a pad, - then this can be given as pad. Only the first character of the pad + If the terminal requires other than a null (zero) character as a pad, + then this can be given as pad. Only the first character of the pad string is used. If the terminal does not have a pad character, specify - npc. Note that ncurses implements the termcap-compatible PC variable; - though the application may set this value to something other than a - null, ncurses will test npc first and use napms if the terminal has no + npc. Note that ncurses implements the termcap-compatible PC variable; + though the application may set this value to something other than a + null, ncurses will test npc first and use napms if the terminal has no pad character. - If the terminal can move up or down half a line, this can be indicated + If the terminal can move up or down half a line, this can be indicated with hu (half-line up) and hd (half-line down). This is primarily use- ful for superscripts and subscripts on hard-copy terminals. If a hard- - copy terminal can eject to the next page (form feed), give this as ff - (usually control L). + copy terminal can eject to the next page (form feed), give this as ff + (usually control/L). - If there is a command to repeat a given character a given number of - times (to save time transmitting a large number of identical charac- - ters) this can be indicated with the parameterized string rep. The - first parameter is the character to be repeated and the second is the + If there is a command to repeat a given character a given number of + times (to save time transmitting a large number of identical charac- + ters) this can be indicated with the parameterized string rep. The + first parameter is the character to be repeated and the second is the number of times to repeat it. Thus, tparm(repeat_char, 'x', 10) is the same as "xxxxxxxxxx". If the terminal has a settable command character, such as the TEKTRONIX - 4025, this can be indicated with cmdch. A prototype command character - is chosen which is used in all capabilities. This character is given - in the cmdch capability to identify it. The following convention is + 4025, this can be indicated with cmdch. A prototype command character + is chosen which is used in all capabilities. This character is given + in the cmdch capability to identify it. The following convention is supported on some UNIX systems: The environment is to be searched for a - CC variable, and if found, all occurrences of the prototype character + CC variable, and if found, all occurrences of the prototype character are replaced with the character in the environment variable. - Terminal descriptions that do not represent a specific kind of known - terminal, such as switch, dialup, patch, and network, should include - the gn (generic) capability so that programs can complain that they do - not know how to talk to the terminal. (This capability does not apply - to virtual terminal descriptions for which the escape sequences are + Terminal descriptions that do not represent a specific kind of known + terminal, such as switch, dialup, patch, and network, should include + the gn (generic) capability so that programs can complain that they do + not know how to talk to the terminal. (This capability does not apply + to virtual terminal descriptions for which the escape sequences are known.) If the terminal has a "meta key" which acts as a shift key, setting the - 8th bit of any character transmitted, this fact can be indicated with - km. Otherwise, software will assume that the 8th bit is parity and it - will usually be cleared. If strings exist to turn this "meta mode" on + 8th bit of any character transmitted, this fact can be indicated with + km. Otherwise, software will assume that the 8th bit is parity and it + will usually be cleared. If strings exist to turn this "meta mode" on and off, they can be given as smm and rmm. If the terminal has more lines of memory than will fit on the screen at - once, the number of lines of memory can be indicated with lm. A value + once, the number of lines of memory can be indicated with lm. A value of lm#0 indicates that the number of lines is not fixed, but that there is still more memory than fits on the screen. - If the terminal is one of those supported by the UNIX virtual terminal + If the terminal is one of those supported by the UNIX virtual terminal protocol, the terminal number can be given as vt. - Media copy strings which control an auxiliary printer connected to the - terminal can be given as mc0: print the contents of the screen, mc4: - turn off the printer, and mc5: turn on the printer. When the printer - is on, all text sent to the terminal will be sent to the printer. It - is undefined whether the text is also displayed on the terminal screen - when the printer is on. A variation mc5p takes one parameter, and + Media copy strings which control an auxiliary printer connected to the + terminal can be given as mc0: print the contents of the screen, mc4: + turn off the printer, and mc5: turn on the printer. When the printer + is on, all text sent to the terminal will be sent to the printer. It + is undefined whether the text is also displayed on the terminal screen + when the printer is on. A variation mc5p takes one parameter, and leaves the printer on for as many characters as the value of the param- eter, then turns the printer off. The parameter should not exceed 255. - All text, including mc4, is transparently passed to the printer while + All text, including mc4, is transparently passed to the printer while an mc5p is in effect.
- Hazeltine terminals, which do not allow "~" characters to be displayed + Hazeltine terminals, which do not allow "~" characters to be displayed should indicate hz. - Terminals which ignore a line-feed immediately after an am wrap, such + Terminals which ignore a line-feed immediately after an am wrap, such as the Concept and vt100, should indicate xenl. - If el is required to get rid of standout (instead of merely writing + If el is required to get rid of standout (instead of merely writing normal text on top of it), xhp should be given. Teleray terminals, where tabs turn all characters moved over to blanks, - should indicate xt (destructive tabs). Note: the variable indicating - this is now "dest_tabs_magic_smso"; in older versions, it was tel- + should indicate xt (destructive tabs). Note: the variable indicating + this is now "dest_tabs_magic_smso"; in older versions, it was tel- eray_glitch. This glitch is also taken to mean that it is not possible to position the cursor on top of a "magic cookie", that to erase stand- - out mode it is instead necessary to use delete and insert line. The + out mode it is instead necessary to use delete and insert line. The ncurses implementation ignores this glitch. - The Beehive Superbee, which is unable to correctly transmit the escape - or control C characters, has xsb, indicating that the f1 key is used - for escape and f2 for control C. (Only certain Superbees have this - problem, depending on the ROM.) Note that in older terminfo versions, + The Beehive Superbee, which is unable to correctly transmit the escape + or control/C characters, has xsb, indicating that the f1 key is used + for escape and f2 for control/C. (Only certain Superbees have this + problem, depending on the ROM.) Note that in older terminfo versions, this capability was called "beehive_glitch"; it is now "no_esc_ctl_c". - Other specific terminal problems may be corrected by adding more capa- + Other specific terminal problems may be corrected by adding more capa- bilities of the form xx.
- Long terminfo entries are unlikely to be a problem; to date, no entry - has even approached terminfo's 4096-byte string-table maximum. Unfor- - tunately, the termcap translations are much more strictly limited (to - 1023 bytes), thus termcap translations of long terminfo entries can + Long terminfo entries are unlikely to be a problem; to date, no entry + has even approached terminfo's 4096-byte string-table maximum. Unfor- + tunately, the termcap translations are much more strictly limited (to + 1023 bytes), thus termcap translations of long terminfo entries can cause problems. - The man pages for 4.3BSD and older versions of tgetent instruct the - user to allocate a 1024-byte buffer for the termcap entry. The entry - gets null-terminated by the termcap library, so that makes the maximum - safe length for a termcap entry 1k-1 (1023) bytes. Depending on what - the application and the termcap library being used does, and where in - the termcap file the terminal type that tgetent is searching for is, + The man pages for 4.3BSD and older versions of tgetent instruct the + user to allocate a 1024-byte buffer for the termcap entry. The entry + gets null-terminated by the termcap library, so that makes the maximum + safe length for a termcap entry 1k-1 (1023) bytes. Depending on what + the application and the termcap library being used does, and where in + the termcap file the terminal type that tgetent is searching for is, several bad things can happen. - Some termcap libraries print a warning message or exit if they find an + Some termcap libraries print a warning message or exit if they find an entry that's longer than 1023 bytes; others do not; others truncate the - entries to 1023 bytes. Some application programs allocate more than + entries to 1023 bytes. Some application programs allocate more than the recommended 1K for the termcap entry; others do not. - Each termcap entry has two important sizes associated with it: before - "tc" expansion, and after "tc" expansion. "tc" is the capability that + Each termcap entry has two important sizes associated with it: before + "tc" expansion, and after "tc" expansion. "tc" is the capability that tacks on another termcap entry to the end of the current one, to add on its capabilities. If a termcap entry does not use the "tc" capability, then of course the two lengths are the same. - The "before tc expansion" length is the most important one, because it - affects more than just users of that particular terminal. This is the - length of the entry as it exists in /etc/termcap, minus the backslash- + The "before tc expansion" length is the most important one, because it + affects more than just users of that particular terminal. This is the + length of the entry as it exists in /etc/termcap, minus the backslash- newline pairs, which tgetent strips out while reading it. Some termcap libraries strip off the final newline, too (GNU termcap does not). Now suppose: @@ -2310,87 +2345,87 @@ o and the application has only allocated a 1k buffer, - o and the termcap library (like the one in BSD/OS 1.1 and GNU) reads - the whole entry into the buffer, no matter what its length, to see + o and the termcap library (like the one in BSD/OS 1.1 and GNU) reads + the whole entry into the buffer, no matter what its length, to see if it is the entry it wants, - o and tgetent is searching for a terminal type that either is the - long entry, appears in the termcap file after the long entry, or - does not appear in the file at all (so that tgetent has to search + o and tgetent is searching for a terminal type that either is the + long entry, appears in the termcap file after the long entry, or + does not appear in the file at all (so that tgetent has to search the whole termcap file). - Then tgetent will overwrite memory, perhaps its stack, and probably - core dump the program. Programs like telnet are particularly vulnera- - ble; modern telnets pass along values like the terminal type automati- - cally. The results are almost as undesirable with a termcap library, - like SunOS 4.1.3 and Ultrix 4.4, that prints warning messages when it - reads an overly long termcap entry. If a termcap library truncates - long entries, like OSF/1 3.0, it is immune to dying here but will + Then tgetent will overwrite memory, perhaps its stack, and probably + core dump the program. Programs like telnet are particularly vulnera- + ble; modern telnets pass along values like the terminal type automati- + cally. The results are almost as undesirable with a termcap library, + like SunOS 4.1.3 and Ultrix 4.4, that prints warning messages when it + reads an overly long termcap entry. If a termcap library truncates + long entries, like OSF/1 3.0, it is immune to dying here but will return incorrect data for the terminal. - The "after tc expansion" length will have a similar effect to the + The "after tc expansion" length will have a similar effect to the above, but only for people who actually set TERM to that terminal type, - since tgetent only does "tc" expansion once it is found the terminal + since tgetent only does "tc" expansion once it is found the terminal type it was looking for, not while searching. - In summary, a termcap entry that is longer than 1023 bytes can cause, - on various combinations of termcap libraries and applications, a core - dump, warnings, or incorrect operation. If it is too long even before - "tc" expansion, it will have this effect even for users of some other - terminal types and users whose TERM variable does not have a termcap + In summary, a termcap entry that is longer than 1023 bytes can cause, + on various combinations of termcap libraries and applications, a core + dump, warnings, or incorrect operation. If it is too long even before + "tc" expansion, it will have this effect even for users of some other + terminal types and users whose TERM variable does not have a termcap entry. - When in -C (translate to termcap) mode, the ncurses implementation of - tic(1m) issues warning messages when the pre-tc length of a termcap - translation is too long. The -c (check) option also checks resolved + When in -C (translate to termcap) mode, the ncurses implementation of + tic(1m) issues warning messages when the pre-tc length of a termcap + translation is too long. The -c (check) option also checks resolved (after tc expansion) lengths.
- It is not wise to count on portability of binary terminfo entries - between commercial UNIX versions. The problem is that there are at - least two versions of terminfo (under HP-UX and AIX) which diverged - from System V terminfo after SVr1, and have added extension capabili- - ties to the string table that (in the binary format) collide with Sys- + It is not wise to count on portability of binary terminfo entries + between commercial UNIX versions. The problem is that there are at + least two versions of terminfo (under HP-UX and AIX) which diverged + from System V terminfo after SVr1, and have added extension capabili- + ties to the string table that (in the binary format) collide with Sys- tem V and XSI Curses extensions.
- Searching for terminal descriptions in $HOME/.terminfo and TER- + Searching for terminal descriptions in $HOME/.terminfo and TER- MINFO_DIRS is not supported by older implementations. - Some SVr4 curses implementations, and all previous to SVr4, do not + Some SVr4 curses implementations, and all previous to SVr4, do not interpret the %A and %O operators in parameter strings. - SVr4/XPG4 do not specify whether msgr licenses movement while in an - alternate-character-set mode (such modes may, among other things, map - CR and NL to characters that do not trigger local motions). The - ncurses implementation ignores msgr in ALTCHARSET mode. This raises - the possibility that an XPG4 implementation making the opposite inter- - pretation may need terminfo entries made for ncurses to have msgr + SVr4/XPG4 do not specify whether msgr licenses movement while in an + alternate-character-set mode (such modes may, among other things, map + CR and NL to characters that do not trigger local motions). The + ncurses implementation ignores msgr in ALTCHARSET mode. This raises + the possibility that an XPG4 implementation making the opposite inter- + pretation may need terminfo entries made for ncurses to have msgr turned off. The ncurses library handles insert-character and insert-character modes - in a slightly non-standard way to get better update efficiency. See + in a slightly non-standard way to get better update efficiency. See the Insert/Delete Character subsection above. - The parameter substitutions for set_clock and display_clock are not - documented in SVr4 or the XSI Curses standard. They are deduced from + The parameter substitutions for set_clock and display_clock are not + documented in SVr4 or the XSI Curses standard. They are deduced from the documentation for the AT&T 505 terminal. - Be careful assigning the kmous capability. The ncurses library wants - to interpret it as KEY_MOUSE, for use by terminals and emulators like - xterm that can return mouse-tracking information in the keyboard-input + Be careful assigning the kmous capability. The ncurses library wants + to interpret it as KEY_MOUSE, for use by terminals and emulators like + xterm that can return mouse-tracking information in the keyboard-input stream. - X/Open Curses does not mention italics. Portable applications must - assume that numeric capabilities are signed 16-bit values. This - includes the no_color_video (ncv) capability. The 32768 mask value - used for italics with ncv can be confused with an absent or cancelled - ncv. If italics should work with colors, then the ncv value must be + X/Open Curses does not mention italics. Portable applications must + assume that numeric capabilities are signed 16-bit values. This + includes the no_color_video (ncv) capability. The 32768 mask value + used for italics with ncv can be confused with an absent or cancelled + ncv. If italics should work with colors, then the ncv value must be specified, even if it is zero. - Different commercial ports of terminfo and curses support different + Different commercial ports of terminfo and curses support different subsets of the XSI Curses standard and (in some cases) different exten- sion sets. Here is a summary, accurate as of October 1995: @@ -2400,15 +2435,15 @@ capability (set_pglen). o SVr1, Ultrix -- These support a restricted subset of terminfo capa- - bilities. The booleans end with xon_xoff; the numerics with + bilities. The booleans end with xon_xoff; the numerics with width_status_line; and the strings with prtr_non. - o HP/UX -- Supports the SVr1 subset, plus the SVr[234] numerics - num_labels, label_height, label_width, plus function keys 11 - through 63, plus plab_norm, label_on, and label_off, plus some + o HP/UX -- Supports the SVr1 subset, plus the SVr[234] numerics + num_labels, label_height, label_width, plus function keys 11 + through 63, plus plab_norm, label_on, and label_off, plus some incompatible extensions in the string table. - o AIX -- Supports the SVr1 subset, plus function keys 11 through 63, + o AIX -- Supports the SVr1 subset, plus function keys 11 through 63, plus a number of incompatible string table extensions. o OSF -- Supports both the SVr4 set and the AIX extensions. @@ -2419,8 +2454,8 @@
- tic(1m), infocmp(1m), curses(3x), curs_color(3x), printf(3), term(5). - term_variables(3x). user_caps(5). + tabs(1m), tic(1m), infocmp(1m), curses(3x), curs_color(3x), curs_vari- + ables(3x), printf(3), term(5). term_variables(3x). user_caps(5).