Control sequences in terminal parameter files

Some sections of the terminal parameter file require character codes to be provided. These are the characters, both printable and unprintable, which are represented by the values 0 to 255 in the ASCII character set.

Sections 3, 4, 5 and 9 require control sequences, which consist of a list of character codes separated by commas. Entries in Section 6 require a single character code, which may come from up to four different character sets. Sections 7, 8 and 10 accept either character codes, or special character mnemonics which are themselves defined in Section 6.

Each code in a control sequence may be entered in a variety of formats, and the formats available may be freely mixed within a single sequence. The method chosen generally follows the format used in the terminal’s manual. All the formats listed below are found in various manuals.

Printable characters

A printable character (codes 32 to 126) may normally be represented by the character itself. The exceptions to this are the space, comma, single quote and double quote characters, for which the mnemonics SPC, COMMA, SQUOTE and DQUOTE should be used.

Unprintable characters

There are a number of different formats available for specifying unprintable characters. For any character, the hexadecimal or decimal value of its ASCII number may be provided. Certain keys may be also defined by control codes or by special mnemonics.

Format

Meaning

^X

Control code. Specifies the code CTRL X, which is produced by holding down the CONTROL key and pressing the key X at the same time. There are a total of 32 control codes: ^@, ^A to ^Z, ^[, ^\, ^], ^^ and ^_.

$x

Hexadecimal value. The code which has the hexadecimal value x, where x is one or more hexadecimal digits (e.g. $0d, $ff).

#n

Decimal value. The code which has the decimal value n where n is one or more decimal digits (e.g. #90, #108).

Mnemonics

The control codes with the ASCII values 0-31 (hex 00-1f) have a set of fairly standardised mnemonics (beginning with (NUL, SOH, STX…), which are listed in The ASCII character set table. These mnemonics may be used as character codes for the characters they represent.

The following additional mnemonics are available:

ESC

The escape character (#27, $1b)

SPC

The space character (#32, $20)

COMMA

The comma character (#44, $2c)

DEL

The DEL character (#127, $7f)

PAD n

Specifies n null characters where n is a number in the range 1-255. There must be a space between PAD and n.

DELAY n

Specifies a delay of at least 10 * n milliseconds where n is a number in the range 1-255. There must be a space between DELAY and n.

The following two mnemonics must always be used, as ordinary quote marks are rejected by the compiler (see Quoted strings below):

DQUOTE

The double quote character (#34, $22).

SQUOTE

The single quote character (#39, $27)

Quoted strings

Quoted strings, either in double or single quotes, may be used in control sequences. Therefore, if the actual single quote ( ’ ) or double quote ( ” ) character is required in a control sequence, the relevant mnemonic (SQUOTE or DQUOTE) must be used.


RELATED TOPICS

Terminal parameter files