Was this helpful?
Format of a Termcap Description
Each termcap entry can be up to 2 KB long, including comment lines.
Consider the following sample termcap description for a fictitious terminal called rti100:
R1|rti100|rti fictitious terminal:\
    :co#132:li#25:\
    :am:bs:\
    :is=\E[0m:cm=\E|%2;%2:
It has an abbreviated name R1 and a long name rti fictitious terminal. (To use this with the forms system, set the TERM_INGRES environment variable/logical to rti100.) The rti100 screen is 132 columns wide and 25 lines high. It has automatic margins (am) and uses Control‑H for the backspace character (bs). The description contains an initialization string (is) and a cursor positioning string (cm).
As shown in this example, the first line of a termcap description is the list of names. All names must be separated by a vertical bar (|). There must be a colon (:) between the last name and the first capability.
If the termcap description is more than one line (as it is for clarity), then each line except the last must end with a backslash (\) to signify continuation. Capabilities, which can be presented in any order, must be separated by colons (:). The last line must end with a colon (:) to signify that it is the end of the description. You can place tabs at the beginning of lines for readability.
Special Characters Used in a Termcap Description
The special symbols used in the termcap description are as follows:
:
Separates capabilities.
|
Separates names.
\
Continues to next line (when at the end of line).
\E
Is the Escape character.
100
Pauses for 100 milliseconds (when before a command).
#
Indicates that capability is a number that immediately follows.
=
Sets capability to a string that follows
^X
Is Control‑X for any X; thus, ^g is Control‑G,^h is Control‑H, etc.
\n
Is the Newline character.
\r
Is the Return character.
\t
Is the Tab.
\b
Is the Backspace.
\f
Produces a Formfeed.
\072
Is a colon (072 is the octal value for :). In general, any character can be specified as a three‑digit octal value of the ASCII character by preceding it with a backslash.
@
When placed after a command, it means do not apply this command. It is used in descriptions that have the tc command. For more information, see Eleven Basic Commands.
Termcap Description Names
Names have a special format that you must follow. The first name must be two letters long. The second name is the common name to which you must set TERM_INGRES. The last name can be a concise description of the terminal's brand and model number. The last name can contain blanks, though the other names can not have blanks.
All names must be separated by a vertical bar (|). Additional names can be placed between the second name and the last name. The additional names can be used as alternative names for TERM_INGRES.
Note:  Names must always be checked for uniqueness. You must check through the termcap file before writing a new description to make sure that the names you want to use have not already been selected. A duplicated name is not recognized; only the first one is used.
How Capabilities of the Terminal Are Specified in a Termcap Description
Capabilities are designated by commands, which must be separated by colons. All commands are two letters long. String and numeric commands are followed by additional information that is read by the forms system. The three types of commands are:
String
Numeric
Boolean
Strings contain sequences of characters. The command must be followed by an equal sign. For example, up=\EA indicates that the command up (which stands for the sequence to move the cursor up) is set to the sequence Escape-A.
Some string commands can be preceded by a time delay, which is referred to as padding. Padding may be required by older, slower terminals (such as the HDS AVT), which require a delay to execute some screen commands, such as clearing the screen. Padding ensures that the terminal has time to execute those commands without losing characters. Modern terminals and terminal emulators will almost never require padding.
The two types of padding are nonproportional (or straight) padding, and proportional padding (to the number of lines affected). To specify straight padding, put the needed time of delay (in milliseconds) before the command. To specify proportional padding, place an asterisk (*) after the amount of time. For example, on the concept 100 terminal, the ta command (tab character) takes a straight time delay of 8 milliseconds, and the cd command (clear display) takes a proportional delay of 16 milliseconds. The termcap entries look like this:
Straight padding:
ta=8\t
Proportional padding:
cd=16*\EarC
Numeric commands are followed by a number sign (#). For example, co#80 indicates that there are 80 columns on the screen. (co is the command which specifies the number of columns on the screen.)
Boolean commands signify the existence of a capability by their presence. They are not followed by any sequence or other symbols.
Last modified date: 08/14/2024