RES=techref.html function header { cat << etx >> $RES

$1

etx } cat > $RES /dev/null # -- HTML Header -------------------------------------------------------------------- cat >> $RES << etx VT100
etx # -- Editors Notes ------------------------------------------------------------------ cat >> $RES << etx

VT100

Please note that this text is under construction

Preface

This document accompanies the Konsole program, which is a terminal emulation for the X Windows System. Since material about the extend and precise semantics of the emulatation intended to be handled by this programs is hard to find on the internet today, it came out nessesary to include a more precise specification within their release. Hopefully, this helps to clearify the relation to the VT100, VT102, Linux, XTerm and ansi.sys (ANSI-BBS) terminals, which are the target of these programs. Further, it specifies which codes are interpreted by them, and what has been omitted.

To begin with, all of the above call themselfes "ANSI" emulations, which makes this notion pretty vage. "ANSI" referes here to the American National Standards Institute's documents X3.41-1974 and X3.64-1977. DEC partially implemented this standart in their VT100 terminal, with some additions. The VT102 is a later extention of that. Both the Linux console and the XTerm emulation implement most of VT102, with some additions. MS stepped in later and produced another ANSI emulation, ansi.sys, for their OS, which became of some relevance in BBS style telecommunication programs. One can view this as a small subset of the VT100 emulation, with some additions, of cause. This situation is further confused by the fact, that often many versions of the above terminals and emulations are out, one able to do a little more or less then the other.


Currently, the body of this document is mainly a concept data base, that referes to the VT100 component of the emulation. Though the codes accepted by konsole are now clearly indicated, a comparison to the xterm and Linux console emulation is missing.

The konsole emulation sources is not linked closely with it's documentation, and, also accurate at the time of writing, it can still fall slightly appart. Work is currently in progress to fix this issue. A decent indexing is on the way also.

Notes & todos

etx # -- Codes -------------------------------------------------------------------------- header "Terminal Control Commands" cat >> $RES << etx The VT100 is an upward and downward software-compatible terminal; that is, previous Digital video terminals have Digital's private standards for control sequences. The American National Standards Institute has since standardized escape and control sequences in terminals in documents X3.41-1974 and X3.64-1977.

The VT100 is compatible with both the previous Digital standard and ANSI standards. Customers may use existing Digital software designed around the VT52 or new VT100 software. The VT100 has a "VT52 compatible" mode in which the VT100 responds to control sequences like a VT52. In this mode, most of the new VT100 features cannot be used.

Throughout this document references will be made to "VT52 mode" or "ANSI mode". These two terms are used to indicate the VT100's software compatibility.

NOTE: The ANSI standards allow the manufacturer flexibility in implementing each function. This document describes how the VT100 will respond to the implemented ANSI central function.

Method of description

All the following in this section is an outline.

Parts of the terminal description

etx header "Control Sequences" cat >> $RES << etx Conceptually, the commands to the terminal emulation are encoded if form of byte sequences to meet the restrictions of the transport media. These sequences have pretty different originations and therefore the format of the sequences are inhomogenous.

Refering both to their origin and form, one can group the overall encoding schemes as follows:

NamePatternScopeComment
Printable Ascii Characters32..126ASCII ECMA This is the most original pattern of all. The characters to be displayed are passed over the chanel and are interpreted by the terminal (emulation) as instructions to display the corresponding glyph of the ascii character set. Contempory emulations include the upper half (128..255) of the extentions to the national ascii character sets, also.
Ascii Control Characters0..26,28..31,127ASCII ECMA Ascii defines some non-printable, but format effecting characters, too. Depending on the emulation, at least some of them are given a meaning. The typically implemented ones are those that are handled by a teletype like device.
Simple Escape SequenceESC CECMA These sequences are made up from an ESC character followed by exactly one other character in the range ???..???.
CSI Sequence ESC [ Parameters {I} C ECMA

The remaining codes are nonstandard but traditionalized hacks.

DEC hacks ESC C D VT100
XTERM hacks ESC ] Pn ; text BEL XTERM

VT52 uses a different (incompatible) set of escape codes. VT100 includes the VT52 emulation as a mode.

Simple Escape SequenceESC CVT52
Complex Escape SequenceESC Y X YVT52

More on Control Sequences

Control Characters

Control characters (codes 0x00 - 0x1f inclusive) are specifically excluded from the control sequence syntax, but may be embedded within a control sequence. Embedded control characters are executed as soon as they are encountered by the VT100. The processing of the control sequence then continues with the next character recieved. The exceptions are: if the ESC character occurs, the current control sequence is aborted, and a new one commences beginning with the ESC just recieved. If the character CAN (0x0c) or the character SUB (0x0e) occurs, the current control sequence is aborted. The ability to embed control characters allows the synchronization characters XON and XOFF to be interpreted properly without affecting the control sequence.

FIXME: I've to check this w.r.t. the "I" component in modern (EMCA) CSI sequences. Evtl. this is not compatible anymore.

CSI Sequences

Control Sequence Introducer (CSI):
An escape sequence that provides supplementary controls and is itself a prefix affecting the interpretation of a limited number of contiguous characters. In the VT100, the CSI is: <ESC>[
Parameter:
1. A string of zero or more decimal characters which represent a single value. Leading zeros are ignored. The decimal characters have a range of 0 (060) to 9 (071).
2. The value so represented.
Numeric Parameter:
A parameter that represents a number, designated by Pn.
Selective Parameter:
A parameter that selects a subfunction from a specified set of subfunctions, designated by Ps. In general, a control sequence with more than one selective parameter causes the same effect as several control sequences, each with one selective parameter, e.g., CSI Psa; Psb; Psc F is identical to CSI Psa F CSI Psb F CSI Psc F.
Parameter String:
A string of parameters separated by a semicolon.
Default:
A function-dependent value that is assumed when no explicit value, or a value of 0, is specified.
Final character:
A character whose bit combination terminates an escape or control sequence.
EXAMPLE: Control sequence to turn off all character attributes, then turn on underscore and blink attributes (SGR).
                      Delimiters
                          / \       
                         /   \       
                         |   |
                        \ / \ /
Sequence:       <ESC>[ 0 ; 4 ; 5 m
                ^^^^^^ ^   ^   ^ ^
                |||||| |   |   | |
                \||||/  \  |  /  +------Final character
                 \||/    \ | /
                 CSI   Selective
                       Parameters
The octal representation of this string is:
   033 0133 060 073 064 073 065 0155
  <ESC>   [   0   ;   4   ;   5    m
Alternate sequences which will accomplish the same thing:

DEC hacks

These form two groups of commands.

In one first the first character is a hash (#) and the following a digit. This command group is used to denote VT100 specific instructions and can safely be sonsidered to be obsolete. See DECALN, DECDHLB, DECDHLT, DECDWL and DECSWL.

The second one is used to specify character set mappings (see SCS). A CSI instruction to do this is specified in ECMA, and this should be used as a replacement.

XTERM hacks

etx header "The Concept Data Base" cat >> $RES << etx The following text is a collection of several sorts of definitions and explainations. It is incomplete in many respects and a working draft. The author is well aware of the fact that this part of the document is of few use without having proper indexes.

All of the following control sequences are transmitted from the Host to VT100 unless otherwise noted. All of the control sequences are a subset of those defined in ANSI X 3.64 1977 and ANSI X 3.41 1974.

The following text conforms to these formatting conventions:

The following attributes below have the following meaning:

etx ./genTC.pl >> $RES header "Modes" cat >> $RES << etx The Following is a list of VT100 modes which may be changed with Set Mode (SM) and Reset Mode (RM) controls.

ANSI Specified Modes

ParameterMnemonicFunction



0 Error (Ignored)
20 LNM Line Feed/New Line Mode

DEC Private Modes

If the first character in the parameter string is ? (077), the parameters are interpreted as DEC private parameters according to the following:
ParameterMnemonicFunction



0 Error (Ignored)
1DECCKM Cursor Key
2DECANM ANSI/VT52
3DECCOLMColumn
4DECSCLMScrolling
5DECSCNMScreen
6DECOM Origin
7DECAWM Auto Wrap
8DECARM Auto Repeat
9DECINLMInterlace
Any other parameter values are ignored.

The following modes, which are specified in the ANSI standard, may be considered to be permanently set, permanently reset, or not applicable, as noted.
MnemonicFunction State
CRM Control Representation Reset
EBM Editing Boundary Reset
ERM Erasure Set
FEAM Format Effector Action Reset
FETM Format Effector Transfer Reset
GATM Guarded Area Transfer NA
HEM Horizontal Editing NA
IRM Insertion-replacement Reset
KAM Keyboard Action Reset
MATM Multiple area transfer NA
PUM Positioning Unit Reset
SATM Selected Area Transfer NA
SRTM Status Reporting TransferReset
TSM Tabulation Stop Reset
TTM Transfer Termination NA
VEM Vertical Editing NA
etx # -- Keyboard Codes ----------------------------------------------------------------- cat >> $RES << etx

Keyboard Codes

The notation <ESC> denotes a single ASCII Escape character, 1Bx.
Cursor Key VT52 mode ANSI mode w/cursor
key mode reset
ANSI mode w/cursor
key mode set
UP <ESC>A<ESC>[A<ESC>OA
DOWN <ESC>B<ESC>[B<ESC>OB
RIGHT<ESC>C<ESC>[C<ESC>OC
LEFT <ESC>D<ESC>[D<ESC>OD
etx # -- Graphics Characters ------------------------------------------------------------ cat >> $RES << etx

Special Graphics Characters

If the Special Graphics set is selected, the graphics for ASCII codes 0137 through 0176 will be replaced according to the following table (see the SCS control sequence). etx awk -f awk.table.graphic < Table.Graphic >> $RES cat >> $RES << etx NOTE 1: Codes 0152-0156 and 0164-0170 are used to draw rectangular grids" each piece of this set is contiguous with other so the lines formed will be unbroken.

NOTE 2: Codes 0157-0163 give better vertical resolution than dashes and underlines when drawing graphs; using these segments, 120 x 132 resolution may be obtained in 132 column mode with the Advanced Video Option installed.

References


This text is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Lars Dölle, 1998 etx