ContentsIndexPreviousNext

The Terminal Database File

The terminal database file, which is similar to the "termcap" file supplied with many UNIX systems, may be edited to add new terminals to the ones it currently supports.

Each line of this file is either blank, a comment (marked by a "#" in column 1) or the definition of a terminal. You can continue a "line" on following lines by ending the line to be continued with a "\" (see below for an example). The "\" character must be the last character on the line.

A terminal definition consists of several fields, each separated by colons. The end of the line marks the end of the definition. The first field is always the name of the terminal. Several names can be placed here, separated by a vertical bar ("|"). The rest of the fields consist of codes that describe various terminal functions. Most of these codes are followed by an equal sign and a coded string that describes how to operate that particular function.

Here is a generic representation of a terminal database file entry, where TNn is a terminal name, tf is a terminal function code, and cs is a coded string to accomplish the function:

 TN1|TN2|TN3:\
:tf=cs:tf=cs:tf=cs:\
:tf=cs:tf=cs:

The coded string that describes a function is just a representation of the control-sequence (or sequences) that the terminal uses to activate that function. These strings consist of the literal characters used in the control-sequence. Several special forms are recognized to aid in describing the control-sequence. The following abbreviations are supported:

\E
an escape character
\n
a new line (control-J)
\r
a carriage return (control-M)
\t
a tab (control-I)
\b
a backspace (control-H)
\f
a form-feed (control-L)
^X
X is any character, treated as control-X
\nnn
three digits treated as an octal value

The following is a list of all of the supported function codes. These are treated in detail in the following sections. Most terminals have only a subset of the full set.

AC
Attributes used by clear screen
AT
Special color for IBM 3164 terminal
B1-B8
Background color 1-8
BL
Blink
C1-C8
Foreground color 1-8
DI
De-initialization string
DL
Default intensity is low
DP
Disable print mode
EP
Enable print mode
GA
Graphics are attributes
GE
Graphic escape
GF
Graphics off
GM
Graphics map
GO
Graphics on
GX
Graphics movement glitch
HI
High-intensity, normal video
LO
Low-intensity, normal video
NM
Normal video (only if "sg" set)
NS
Screen does not scroll when corner is used
OC
One color can be displayed at a time
RA
Reverse video, alternate intensity
RB
Reverse video, blink
RU
Reverse video, underline
RV
Reverse video
UL
Underline
VB
Visible background
W3
Set terminal width to 132 columns
W8
Set terminal width to 80 columns
al
Insert (add) line
bc
Backspace cursor (defaults to ^H)
cd
Clear to end-of-screen
ce
Clear to end-of-line
cl
Clear screen
cm
Cursor positioning
co
Number of screen columns (default 80)
dl
Delete line
do
Down one line (defaults to ^J)
is
Initialization string
is1
Additional initialization string
is2
Additional initialization string
li
Number of screen lines (default 24)
nd
Non-destructive space
sg
Standout-mode glitch (uses magic cookies)
tc
Continue description with another entry
up
Cursor up one line
ve
Set cursor to normal
vi
Set cursor to invisible
vs
Set cursor to bright

The codes available to represent various keys are listed in the Table of Keys in the "Setting Up Your Terminals" chapter.

All of the function codes described with lower-case characters are identical to ones found in the UNIX "termcap" file. These sequences can be taken verbatim from "termcap" and included in the ACUCOBOL-GT terminal database file when you are adding a new terminal entry.


To help with this discussion, an example of an entry for a DEC VT-100 will be developed. At each step of the example, the new portion of the entry is in bold type. Initially, we need to assign a set of names that we want to use to refer to the terminal. For example:
vt100|vt-100|DEC VT-100:

This allows for any of the names "vt100", "vt-100", or "DEC VT-100" to be used for the TERM or A_TERM variable. By convention, the last name in the list is a long, descriptive name.
More:

Required Functions

Additional Screen Functions

Video Attributes

Color

Function Keys

Line Drawing

Graphical Window and Control Emulation

Initialization

Print Functions

Continued Entries