Attribute Setting - Termcap Reference

PRO/5 makes the assumption that the current attributes affect only the characters written to the display, and none of the characters on the rest of the line or screen. Currently, there is no method for handling terminals that do not operate in this manner. However, most terminals may be set to perform in a similar mode; typically set in the "is" string.

If setting an attribute causes the terminal to overwrite a position on the display, PRO/5 cannot use that attribute. Terminals that exhibit this behavior usually have the capability set to "sg#1" and/or "ug#1".

Not all attributes on a terminal with this problem exhibit this problem. A TeleVideo 925 can handle the intensity attribute correctly but none of the other attributes.

One of the most effective methods of controlling a terminal is using the American National Standards Institute (ANSI) escape sequences. PRO/5 will use the ANSI attribute setting sequence with the non-standard termcap Boolean flag "AA" in the termcap entry. The various PRO/5 attributes map to the ANSI attributes in the following manner.

Attribute

Select

High-intensity

1

Reverse

7

Underline

4

Blink

5

If the "AA" mode is set (ANSI attributes), the reset sequence "\E[0m" is sent prior to any color or attribute setting. In addition, each of the mode setting strings are sent to the terminal as an entire escape sequence (this is due to bugs in some emulations of ANSI mode setting). Note that in ANSI mode set all of the attributes may be independently set, yet all of the attributes are reset with a parameter of "0."

If your terminal uses ANSI mode set and reset, but does not have some of the modes, "AA" can be used to describe those capabilities the terminal does support by listing the set code for each of the following attributes:

  • BRIGHT

  • REVERSE

  • UNDERLINE

  • BLINK

The "AA" string for a standard ANSI terminal with all modes would then be "AA=1745." If your terminal did not have a high-intensity mode "1" but did have a low-intensity mode "2," the capability "AA=2745" would cause the low intensity to be set when the terminal was not in BRIGHT mode.

If the terminal is not an ANSI standard terminal, or the AA flag cannot be set, the following capabilities may be set:

Name

Mode

MA=str

High intensity/protect on

MB=str

High intensity/protect off

MC=str

Blink on

MD=str

Blink off

ME=str

Reverse video on (see Cf )

MF=str

Reverse video off

us=str

Underscore on

ue=str

Underscore off

NOTE: All of the names in the "MA..MF" sequence are non-standard.

These sequences assume that it is possible to turn on/off each desired attribute without affecting any other attribute. If this is not possible, one of the following sequences can be used:

Name

Description

Cm=str

PRO/5 to terminal attribute value map

Cn=str

:cm: Like sequence for setting attributes

Co=str

Attribute setting leading sequence

Cp=str

Attribute setting sequences

Cq=str

Attribute setting trailing sequence

Cr#val

Number of entries in "Cp" capability

xa

Flag indicating that terminal does not fill cleared regions with the current colors or attributes

The "Cm" string defines the value to be used for each of the PRO/5 attributes: BRIGHT, REVERSE, UNDERLINE, and BLINK. The appropriate values in the mask are added together. The resulting value is used in either the "Cn" sequence or as an index into the "Cp" string, if the "Cn" capability is not defined. If the "Cp" string is defined, the "Cr#" must be set to indicate the number of entries in the "Cp" string.

If it is necessary to set a protect mode in conjunction with an intensity change and the termcap entry is using the Cm, MA and MB may then be used for the protect modes. If MA and MB are used for setting protect mode, ensure these do not reset any other modes.

The "xa" mnemonic is used when a terminal does not fill regions cleared using the "cl", "cd", and "ce" capabilities. Defining this will cause PRO/5 to "clear" regions with spaces only when the current attributes are considered visible; for example, when the terminal has color and the background color is set to something other than black, or the character attributes are reverse or underline.

As an example, use the following table for a terminal that supports two modes, BRIGHT and REVERSE:

Mode

Sequence

None

\ERa

Bright

\ERb

Reverse

\ERc

Bright+reverse

\ERd

This terminal could be supported by either of the following descriptions:

:Cm=1200:Cn=\ER%r%+a:
:Cm=1200:Co=\ER:Cp=abcd:Cr#4:

The last attribute to be set/reset is the graphics on/off, used in line drawing. This uses the termcap capabilities "GS" and "GE". Neither "GS" nor "GE" should affect any of the other attributes or colors. The "GS" or "GE" sequence is sent after all other color and attribute settings have been performed.