Natural Termcap (NATTERMCAP) Utility

The Natural Termcap (NATTERMCAP) utility is used to create, modify and test terminal capabilities used by Natural. These terminal capabilities are stored in the terminal database SAGtermcap.

Since there are no standard terminal type definitions, Software AG does not assume any responsibility for the completeness and the correctness of the terminal types contained in SAGtermcap. A terminal type standard used for Digital Equipment Corporation's VT terminals is ANSI X3.64 (corresponds to ISO 6429).

The Natural Termcap Utility documentation covers the following topics:


General Settings

This section provides information on environment variables and parameters that can be used to specify general settings of the Natural Termcap utility. For the parameters that can be specified when invoking the Natural Termcap utility, see Dynamic Parameters.

Environment Variables

The Natural Termcap utility uses the following environment variables:

Variable Explanation
TERM Used for the currently active terminal type.
NATTERM Used for the Natural terminal type. If this variable is not set or defined, the value assigned to TERM (see above) is used.
NATTCAP Used to specify a different terminal database than SAGtermcap.
COLUMNS Used for terminal-screen width. If this variable is not set or defined, the current screen width is used. Otherwise, the value assigned to the capability co is used. If the value assigned exceeds the screen width then the current screen width is used.
LINES Used for terminal screen page size. If this variable is not set or defined, the current screen page size is used. Otherwise, the value assigned to the capability li is used. If the value assigned exceeds screen page size then the current screen page size is used.

Terminal Mode

The Natural Termcap utility is a screen I/O application. Therefore, it needs a terminal database and a terminal type to display menus and windows on the screen. By default, the Natural Termcap utility uses the same terminal database and type that Natural uses.

Natural retrieves the terminal type as follows:

  1. It takes the contents of the environment variable NATTERM.

  2. If NATTERM is not set or defined, it takes the contents of the system environment variable TERM.

Natural retrieves the terminal database as follows:

  1. It takes the contents of the environment variable NATTCAP.

  2. If NATTCAP is not set, it retrieves the terminal database name from the NATTCAP entry in the local configuration file NATURAL.INI.

  3. If this terminal database could not be found, the Natural Termcap utility tries to locate a terminal database named SAGtermcap in the current directory.

To avoid this automatism, the Natural Termcap utility offers a predefined terminal database in the dynamic parameter TERMCAP with a limited number of terminal types. These types can be accessed by specifying the dynamic parameter DISPLAY.

Special Control Codes

The following table gives an overview of unprintable characters, as well as characters that have a special meaning in terminal capability syntax:

Control Code Explanation
\E Escape character
\b Backspace character
\n New line
\r Carriage return character
\t Tab character
\xxx Octal value of xxx; must be three characters
\072 The character colon (:); the Natural Termcap utility uses the colon (:) as an internal separator
^x Control-x, where x is any letter

Example:

If the function key PF10 is to be defined as F10 on a DEC VT220 terminal, the code of F10 is:

<ESCAPE>[21~

Specify the following for capability PF10:

\E[21~

If the character tilde (~) is not available on the keyboard, use the octal value of tilde instead. Tilde is defined as octal 176. The alternative specification is then:

\E[21\176

Invoking the Natural Termcap Utility

Start of instruction setTo invoke the Natural Termcap utility

  • At the operating system prompt, enter the following:

    nattermcap [dynamic-parameters]

    where dynamic-parameters denotes one or more parameters that can be specified with the command (see Dynamic Parameters).

    The NATURAL Termcap Utility screen appears with the name of the currently active terminal in the top right-hand corner of the screen.

    The screen provides the following menu options:

    Menu Explanation
    File Creates, reads, saves and deletes a terminal entry.
    Edit Views and sets terminal capabilities.
    Search Searches for a specific capability by name.
    Test Tests capabilities.
    Options Modifies the default key definition and shows or hides terminal copy capabilities. Terminal copy capabilities are capabilities included from another terminal entry.
    Help Provides help on each capability and on the usage of the dynamic parameters.

The menus provided on the NATURAL Termcap Utility screen are explained in the following sections.

Dynamic Parameters

The dynamic parameters that can be supplied with the NATTERCAMP command when invoking the Natural Termcap utility are described in the following section. These parameters provide quick access to the capabilities of a terminal type. As an alternative, you can use the menu options provided on the NATURAL Termcap Utility screen.

For explanations of the symbols used in the parameter syntax, refer to System Command Syntax in the System Commands documentation.

Dynamic Parameter Explanation
DISPLAY
Used to define the terminal type for the Natural Termcap utility itself. If no DISPLAY parameter is specified, the Natural terminal database SAGtermcap is used and the same terminal type tracking mechanism as for Natural is in effect.
 
Syntax:

DISPLAY = {#vt100|#vt100ng|#vt220|#vt220ng|wyse60|#tty|other}

 
Possible Values:
   
#vt100 Use the terminal entry DEC vt100 from the internal terminal database.
   
#vt100ng Similar to #vt100, but graphic line characters will be replaced by single characters such as - (minus signs), | (vertical lines) and + (plus signs).
   
#vt220 Use the terminal entry DEC vt220 from the internal terminal database.
   
#vt220ng Similar to #vt220, but graphic line characters will be replaced by single characters such - (minus signs), | (vertical lines) and + (plus signs).
   
#wyse60 Use the terminal entry wyse60 from the internal terminal database.
   
#tty Use the terminal entry tty from the internal terminal database. The tty terminal works in a line-oriented way without using escape control sequences. Only a few functions are available if this terminal entry is selected.
   
other Use any other terminal type in the terminal database, for example, xterm.
EDIT

Used to view and/or modify a specific terminal capability. If the capability is found, the associated window is displayed and the cursor is positioned in the specified field. If the capability cannot be found, an error message will be displayed and the Natural Termcap utility terminates.

Syntax:

EDIT = capability

Capability:

Any terminal capability known in Natural can be specified. A list of capabilities can be found in the sections Terminal Capabilities - Overview and Terminal Capabilities - Sorted by Name.

EXIT

Used to terminate the utility after all parameters have been processed.

Example:

NATTERM EDIT = PF10 EXIT

After modifying the function key PF10, the utility terminates immediately.

HELP
Used to get help about a specific capability or about using the Natural Termcap utility.
   
Syntax:

HELP = {CAP|USAGE|capability}

   
Possible Values:
   
CAP Displays help for all capabilities sorted by capability name.
   
USAGE Displays all dynamic parameters in the Natural Termcap utility.
   
capability Displays help for a specific capability.
REPORT

Used to create by default a text file with a detailed description of the current terminal in the Natural TMP directory.

Syntax:

REPORT[=file-name]

where file-name is the name of the text file, which is to contain the description.

If no name is specified, terminal-name.txt is used.

SAVE

Used to save all modifications of the current terminal entry.

Syntax:

SAVE[=terminal-name]

where terminal-name is a new terminal entry in the terminal database where all capabilities of the current terminal are stored. Corresponding menu option: File > Save As.

If no name is specified, the current terminal-name is used. Corresponding menu option: File > Save.

TERM

Used to read in a different terminal entry. If this parameter is not specified, the current Natural terminal type is used (NATTERM or TERM).

Syntax:

TERM = terminal-name

where terminal-name is any type of a given terminal contained in the terminal database.

TERMCAP

Used to work with a different terminal database. If this parameter is not specified, the current Natural terminal database is used (NATTCAP).

Syntax:

TERMCAP = database-name

where database-name is the database path and file name.

TEST

Opens the specified test window.

 
Syntax:

TEST = {CONSISTENCY|COLORS|GRAPHICS|KEYS|VIDEO}

   
Possible Values:
   
CONSISTENCY Checks whether the function keys are uniquely defined.
   
COLORS All available colors are displayed with sample text.
   
GRAPHICS A single-line and a double-line box are displayed.
   
KEYS A text on any pressed key will be displayed. The window can be closed by pressing one of the following character keys: E, Q, X, or . (period).
   
VIDEO Displays video attributes such as blinking, underlined and reversed video.

Terminating the Natural Termcap Utility

Start of instruction setTo terminate the Natural Termcap utility

  • From the File menu, choose Exit.

    Or:
    Set the EXIT parameter as described in Dynamic Parameters.

    The Natural Termcap utility is terminated and the operating system prompt appears.

Terminal Copy Capabilities

Terminal copy capabilities (TCs) are capabilities transferred from another terminal entry, like the #include directive of a C program. However, if capabilities are already defined in the current entry, the transferred capabilities are ignored. This makes the entries more efficient, not only by reducing redundancies, but also by ensuring that related entries are kept consistent. Capabilities read from a terminal copy entry are marked with [TC] to the right of the input field. Additionally, the name of the entry from where this capability is transferred is shown in the top right corner of the menu, above the terminal name.

Once a terminal capability has been modified, it loses the link to the transferred terminal entry and the modification is made to the current terminal entry.

Start of instruction setTo display the current terminal entry without any terminal copy capabilities

  1. On the NATURAL Termcap Utility screen, choose Terminal Copy Capabilities from the Options menu.

    The Terminal Copy Capabilities window appears.

  2. Select HIDE.

Example:

Assume TERM is set to vt100 and the vt100 (vt220) terminal entry in the terminal database looks as follows:

vt100 entry:

ti = \E =
ESC = \E
ETO = 300
tc = vt220

vt220 entry:

ti = \E[0m
cr = \r

The combined terminal entry for the terminal type vt100 would be:

vt100:

ti = \E = /* taken from the original vt100 entry
ESC = \E  /* taken from the original vt100 entry
ETO = 300 /* taken from the original vt100 entry
cr = \r   /* transferred from vt220 entry

The capability ti( = \E[0m) from the vt220 terminal is ignored, because ti is already defined in the vt100 entry.

Key Definitions

The function keys provided in the definition windows of the Natural Termcap utility are described in the following table:

Key Explanation
CTRL+A Inserts ANSI definitions.
CTRL+E Evaluates keys automatically.
CTRL+N Inserts non-graphic characters for frames.
CTRL+P Gets help.
CTRL+V Tests capabilities.

Start of instruction setTo modify the predefined function keys

  1. On the NATURAL Termcap Utility screen, choose Key Assignments from the Options menu.

    The Key Assignments window appears.

  2. Modify the required function key(s) listed under the Key Name column.

    You can only specify control keys (CTRL+A to CTRL+Z).

File Menu

When you select File from the NATURAL Termcap Utility screen, a selection list containing the following functions is displayed:

Function Explanation
New Creates a new terminal entry in the current terminal database.
Read Reads a terminal entry from the terminal database.
Save Saves terminal capabilities to the current terminal entry.
Save As Saves terminal capabilities to a different or new terminal entry.
Delete Removes the current terminal entry from the terminal database.
Generate Report Generates a text file including information about the description, aliases and capabilities of the current terminal entry. The text file will be stored by default in the Natural TMP directory as terminal-name.txt, for example, xterm.txt.
Move Moves the terminal entry physically to the top of the terminal database. If a terminal is on top of the database, the access time during the terminal initialization will be improved.
Import Database Allows working with a terminal database other than Natural's SAGtermcap.
Export Database Saves the whole terminal database and all terminal entries with a different path and/or name than Natural's SAGtermcap.
Properties Displays detailed information about the terminal database, terminal entry, environment variables and display type.
Exit Exits the Natural Termcap utility.

Edit Menu

When you select Edit from the NATURAL Termcap Utility screen, a selection list containing all capabilities grouped by topic is displayed:

After you have selected a topic, the corresponding window is displayed in which you can edit individual Natural terminal capabilities.

Depending on the window displayed, the following different types of input fields are provided:

  • boolean, where only ON or OFF can be specified.

  • numeric, where only digits (0 to 9) can be specified.

  • string, where 32 alphanumeric characters can be specified, with the exception of terminal capabilities te and ti, for which 132 characters can be specified;

  • description, where 132 alphanumeric characters can be specified.

For further information on the individual Natural terminal capabilities to be edited, see the sections Terminal Capabilities - Overview and Terminal Capabilities - Sorted by Name.

Search Menu

When you select Search from the NATURAL Termcap Utility screen, a selection list containing all capabilities sorted by name is displayed: see Terminal Capabilities - Sorted by Name. After you have selected a capability, a window is displayed which corresponds to the window invoked with the appropriate Edit menu option.

Test Menu

When you select Test from the NATURAL Termcap Utility screen, a selection list containing the following functions is displayed:

Function Explanation
Colors Tests all foreground and background colors.
Consistency Searches for inconsistent key definitions. A list of affected keys is displayed if they are not unique.
Keys Displays the name of a pressed key. Leave this functions by pressing one of the following character keys: E, Q, X, or . (period).
Line Graphics Tests the graphic line capabilities used for drawing window frames.
Video Attributes Tests all video attributes.

Options Menu

When you select Options from the NATURAL Termcap Utility screen, a selection list containing the following functions is displayed:

Function Explanation
Terminal Copy Capabilities Shows or hides the terminal capabilities included from a different terminal entry specified by the capability tc.
Key Assignments Modifies the default key assignments of the utility.

Help Menu

When you select Help from the NATURAL Termcap Utility screen, a selection list containing the following functions is displayed:

Function Explanation
Topics Invokes a detailed help section for a given topic, such as NAME, REPORT, TC or TEST.
Capabilities Invokes a detailed help section for each capability.
Usage Displays information on how the dynamic parameters are used.
About Displays product information.

Terminal Capabilities - Overview

This section provides an overview of all terminal capabilities sorted by topic. The topics correspond to the items in the Edit menu.

Colors

Name Description
ct Terminal type: color (ON) or monochrome (OFF)
bgbla Screen background color
fgblu Foreground color blue; Natural color definition CD=BL (*)
fggre Foreground color green; Natural color definition CD=GR (*)
fgmag Foreground color pink; Natural color definition CD=PI (*)
fgred Foreground color red; Natural color definition CD=RE (*)
fgcya Foreground color turquoise; Natural color definition CD=TU (*)
fgwhi Foreground color white; Natural color definition CD=NE (*)
fgyel Foreground color yellow; Natural color definition CD=YE (*)
ctres Foreground color for reverse video; Natural attribute definition AD=V (*)
bgblu Background color blue
bggre Background color green
bgmag Background color pink
bgred Background color red
bgcya Background color turquoise
bgwhi Background color white
bgyel Background color yellow

* For detailed information on the Natural definitions AD and CD, see the appropriate session parameters AD and CD described in the Natural Reference documentation.

Cursor Keys and Modes

Cursor keys can be set in two modes: application mode or normal (numeric) mode. In application mode, the numeric keypad keys are assigned different tasks than when in normal mode.

Name Description
kd Cursor key down (in normal mode)
kl Cursor key left (in normal mode)
kr Cursor key right (in normal mode)
ku Cursor key up (in normal mode)
@7 Cursor key end
kh Cursor key home
CKNO Normal cursor key mode
CKAP Application cursor key mode
cm Cursor motion
CNL Cursor next line
ve Cursor visible
vi Cursor invisible
DK Cursor key down (in application mode)
LK Cursor key left (in application mode)
RK Cursor key right (in application mode)
UK Cursor key up (in application mode)

Description and Comments

These fields can be used to describe the terminal entry or to add some comments.

Editing Keys

Name Description
bc Backspace key
bcvt Alternative backspace key
bt Backtab key
cr Carriage return key
dc Delete character key
KDEL Delete to end of field key
ESC Escape key
ETO Escape timeout value in milliseconds
%1 Help key
kI Insert or overstrike mode key
NLFF Next line first field key
kN Page down (next) key
PD Alternative page down (next) key
kP Page up (previous) key
PU Alternative page up (previous) key
&2 Refresh key
ta Tab key

Initialization and Reset

Name Description
TICL Clear screen after initialization
TIRA Reset attributes after initialization
TIGR Enable line graphics after initialization
TICI Cursor invisible after initialization
TICV Cursor visible after initialization
TIAK Application keypad after initialization
TINK Numeric keypad after initialization
TIAC Application cursor key mode after initialization
TINC Normal cursor key mode after initialization
TIDB Dark background after initialization
TILB Light background after initialization
TIIM Insert mode after initialization
TIOM Overstrike mode after initialization
ti Additional initialization sequence
TECL Clear screen after termination
TERA Reset video attributes after termination
TENL Cursor next to line after termination
TECV Cursor visible after termination
TECI Cursor invisible after termination
TEAK Application keypad after termination
TENK Numeric keypad after termination
TEAC Application cursor key mode after termination
TENC Normal cursor key mode after termination
TEDB Dark background after termination
TELB Light background after termination
te Additional sequence after termination

Keypad Keys for Mathematical Operations

Keypad Description
KP01 Single null
KP1 One
KP2 Two
KP3 Three
KP4 Four
KP5 Five
KP6 Six
KP7 Seven
KP8 Eight
KP9 Nine
KPADD Add
KPSUB Subtract
KPDIV Divide
KPMUL Multiply
KPTS Thousand separator
KPDP Decimal point
KPRES Result

Line Graphics

Name Description
eA Enable line graphics
as Graphics mode on
ae Graphics mode off
G1 Single upper-right corner character
GD1 Double upper-right corner character
G2 Single upper-left corner character
GD2 Double upper-left corner character
G3 Single lower-left corner character
GD3 Double lower-left corner character
G4 Single lower-right corner character
GD4 Double lower-right corner character
GH Single horizontal bar character
GDH Double horizontal bar character
GV Single vertical bar character
GDV Double vertical bar character

Miscellaneous

Name Description
bl Audio bell
vb Visual bell
cl Clear screen
ce Clear to end of line
ks Keypad mode application
ke Keypad mode numeric
xi Scroll glitch
TCS External terminal/printer character set, for more information, see Support of Different Character Sets with NATCONV.INI in the Operations documentation.
tc Terminal copy

Name and Aliases

A name and up to 30 aliases can be defined for each entry.

PA and PF Keys

Key Description
PA1 Attention key PA1
PA2 Attention key PA2
PA3 Attention key PA3
PF1 Function key PF1
PF2 Function key PF2
...
PF47 Function key PF47
PF48 Function key PF48

Right-To-Left Support

Name Description
RTLF Right-to-left language toggle key for fields
RTLS Right-to-left screen toggle key
RTLM Set RTL input mode
LTRM Set LTR input mode

Screen Dimension and Appearance

Name Description
li Number of screen rows (if not specified or value exceeds current screen rows, take the current screen rows)
co Number of screen columns (if not specified or value exceeds current screen columns, take the current screen columns)
DAR Dark background, light text
LIG Light background, dark text

Video Attributes

Name Description
mb Blinking on; Natural attribute definition AD=B (*)
BR Blinking off
adc Cursive/italics on; Natural attribute definition AD=C (*)
adc0 Cursive/italics off
md Intensified (bold) on; Natural attribute definition AD=I (*)
HR Intensified off
mr Reversed on; Natural attribute definition AD=V (*)
mr0 Reversed off
us Underlined on; Natural attribute definition AD=U (*)
ue Underlined off
me Reset attributes; Natural attribute definition AD=D (*)
so Standout mode on
se Standout mode off
xs Standout glitch

* For detailed information on the Natural attribute definition AD, see the appropriate session parameter AD described in the Natural Reference documentation.

Terminal Capabilities - Sorted by Name

This section lists all terminal capabilities sorted by name. These capabilities correspond to the capabilities in the Search menu.

Name Description
%1 Help key
&2 Refresh key
@7 Cursor key end
adc Cursive/italic on; Natural attribute definition AD=C (*)
adc0 Cursive/italic off
ae Graphics mode off
as Graphics mode on
bc Backspace key
bcvt Alternative backspace key
bgbla Screen background
bgblu Background color blue
bgcya Background color turquoise
bggre Background color green
bgmag Background color pink
bgred Background color red
bgwhi Background color white
bgyel Background color yellow
bl Audio bell
BR Blinking off
bt Backtab key
ce Clear to end of line
CKAP Application cursor key mode
CKNO Normal cursor key mode
cl Clear screen
cm Cursor motion
CNL Cursor next line
co Number of screen columns; if not specified or value exceeds current screen columns, take the current screen columns
cr Carriage return key
ct Color terminal
ctres Foreground color for reverse video; Natural attribute definition AD=V (*)
DAR Dark background, light text
dc Delete character key
DK Cursor key down (in application mode)
eA Enable line graphics
ESC Escape key
ETO Escape timeout value
fgblu Foreground color blue; Natural color definition CD=BL (*)
fgcya Foreground color turquoise; Natural color definition CD=TU (*)
fggre Foreground color green; Natural color definition CD=GR (*)
fgmag Foreground color pink; Natural color definition CD=PI (*)
fgred Foreground color red; Natural color definition CD=RE (*)
fgwhi Foreground color white; Natural color definition CD=NE (*)
fgyel Foreground color yellow; Natural color definition CD=YE (*)
G1 Single upper-right corner character
G2 Single upper-left corner character
G3 Single lower-left corner character
G4 Single lower-right corner character
GD1 Double upper-right corner character
GD2 Double upper-left corner character
GD3 Double lower-left corner character
GD4 Double lower-right corner character
GDH Double horizontal bar character
GDV Double vertical bar character
GH Single horizontal bar character
GV Single vertical bar character
HR Intensified off
kd Cursor key down (in normal mode)
KDEL Delete to end of field key
ke Keypad mode numeric
kh Cursor key home
kI Insert or overstrike mode key
kl Cursor key left (in normal mode)
kN Page down (next) key
kP Page up (previous) key
KP01 Single zero (0) keypad key
KP1 One
KP2 Two
KP3 Three
KP4 Four
KP5 Five
KP6 Six
KP7 Seven
KP8 Eight
KP9 Nine
KPADD Add
KPDIV Divide
KPDP Decimal point
KPMUL Multiply
KPRES Result
KPSUB Subtract
KPTS Thousand separator
kr Cursor key right (in normal mode)
ks Keypad mode application
ku Cursor key up (in normal mode)
li Number of screen rows; if not specified or value exceeds current screen rows, take the current screen rows
LIG Light background, dark text
LK Cursor key left (in application mode)
LTRM Set LTR input mode
mb Blinking on; Natural attribute definition AD=B (*)
md Intensified (bold) on; Natural attribute definition AD=I (*)
me Reset attributes; Natural attribute definition AD=D (*)
mr Reversed on; Natural attribute definition AD=V (*)
mr0 Reversed off
NLFF Next line first field key
PA1 Attention key PA1
PA2 Attention key PA2
PA3 Attention key PA3
PD Alternative page down (next) key
PF1 Function key PF1
PF2 Function key PF2
...  
PF47 Function key PF47
PF48 Function key PF48
PU Alternative page up (previous) key
RK Cursor key right (in application mode)
RTLF Right-to-left language toggle key for fields
RTLM Set RTL input mode
RTLS Right-to-left screen toggle key
se Standout mode off
so Standout mode on
ta Tab key
tc Terminal copy
TCS External terminal/printer character set.
te Additional sequence after termination
TEAC Application cursor key mode after termination
TEAK Application keypad after termination
TECI Cursor invisible after termination
TECL Clear screen after termination
TECV Cursor visible after termination
TEDB Dark background after termination
TELB Light background after termination
TENC Normal cursor key mode after termination
TENK Numeric keypad after termination
TENL Cursor next to line after termination
TERA Reset video attributes after termination
ti Additional initialization sequence
TIAC Application cursor key mode after initialization
TIAK Application keypad after initialization
TICI Cursor invisible after initialization
TICL Clear screen after initialization
TICV Cursor visible after initialization
TIDB Dark background after initialization
TIGR Enable line graphics after initialization
TIIM Insert mode after initialization
TILB Light background after initialization
TINC Normal cursor key mode after initialization
TINK Numeric keypad after initialization
TIOM Overstrike mode after initialization
TIRA Reset attributes after initialization
ue Underlined off
UK Cursor key up (in application mode)
us Underline on; Natural attribute definition AD=U (*)
vb Visual bell
ve Cursor visible
vi Cursor invisible
xi Scroll glitch
xs Standout glitch

* For detailed information on the Natural definitions AD and CD, see the appropriate session parameters AD and CD described in the Natural Reference documentation.