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.


I'm working towards a close integration of the konsole's source code with this document, but it is still a long way to go.

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, though the codes accepted and produced by konsole should be properly listed. Work is currently in progress to fix this issue.

Notes & todos


Introduction

In a traditional UNIX installation a single machine (host) served several users by means of terminals attached to this host by a serial cable. These terminals (end points) where specialized devices, either regular ttys (printer with keyboard) or later more sophisticated things with cathode ray tubes.

      +-----------+                      +------------+
      |           |                      |            |
      |           | -------------------> |            |--> Printer and/or Display
      |   UNIX    |    bi-directional    |  Terminal  |
      |   host    |    serial line       |   Device   |
      |           | <------------------- |            |<-- Keyboard and Mouse
      |           |                      |            |
      +-----------+                      +------------+
  

Today, hardware has become so cheap, that each single user could be provided with a complete host/display combination for the former price of a terminal.

Additional, and here we come to the X in the emulation, display devices have become graphical while the original terminal where only able to show characters but not graphics.

To allow programs designed for the original configuration to be used in the contemporary setup, "terminal emulations" where invented. In these emulations, the whole original setup is simulated.

The serial cable is folded into the operating system as a sort of loop back device, and a program, the terminal emulation, uses modern means of graphical user interfaces to behave like an earlier terminal. To complete the picture, the host in the diagram is replaced by the application that runs in the emulation (typically a shell or an old editor). So, terminal emulations are in fact interfaces to character oriented applications.

This document describes the implementations of a program named "konsole", which is such an X terminal emulation. Since konsole is distributed under the GPL, meaning that it's source code is available to whoever likes to hack on it, the program would be incomplete without a proper introduction into the code and it's concepts. Thus, this text is to complement the program and the source with the remaining informations to make a complete product.

A first refinement

Before we can come to the actual implementation, quite some notions have to be introduced. We have to get us an idea what a terminal emulation does in more detail.

To this end, a simple model of the terminal and it's operation is given, which is later extended and refined as we come deeper into matter and implementation.

At some level conception, a terminal can be described as a (abstract) data model. This means it has some type of state together with operations on that data type. These operations are somehow encoded to be passed over the serial line.

The concrete model is often loosely named the "emulation", the specific encoding chosen, the "protocol".

There are two principle models in use. The first, stream like one, which is related to a tty, consideres the terminal as an indefinit long and wide sheet of paper on which a printer head types the characters that come in over the line. Typical examples are shell scripts, make and other programs producing sequential protocols of their activity. Their basic data type is a list of list of characters.

The second principle model is used by applications written especially for crt devices, so called full screen applications. These treat the terminal as a matrix of characters where each position can be individually addressed and written to. Typical representatives are full screen editors like vi and emacs, file managers like mc and mail readers like mutt.

Though the second model is newer, it's age does not imply a preference. To the contrary, both models have a right for their own and are both to be supported. The first model is fully expressed within konsole in form of it's ref:history buffer.

Note, that although the second model definitely build on the first one in almost any respect, it cannot fully express it, since it introduces a finite line length, while the first model works with indefinite lines.

Since application with both view of things are typically run within the same session, some effort has been made within konsole to maintain both ideas simultaniously, but only with limited success so far.

In both models, the notion of a current position (historically a printer's head, nowadays visualized by a cursor) is present. "Printing" a charater at the current position and advancing the head together with the starting a new line are the most fundamental operations of the emulation.

The full screen model basically adds the possibility to position the cursor and to overwrite and clear the screen.

A plethora of additional (more or less usefull) commands are then added on this by every specific emulation, see below for the awful details.

Parts of the model

All the following in this section is an outline.

Parts of the terminal description

Control Sequences

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 a 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.

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

Host to Terminal (Instructions by Code)

CSI codes

ICH CSI @ {Pn} Insert Character
CUU CSI A {Pn} Cursor Up
CUD CSI B {Pn} Cursor Down
CUF CSI C {Pn} Cursor Foreward
CUB CSI D {Pn} Cursor Backward
CHA CSI G {Pn} Cursor Horizontal Absolute
CUP CSI H {Pn;Pn} Cursor Position
ED CSI J {Ps} Erase in Display
EL CSI K {Ps} Erase in Line
IL CSI L {Pn} Insert Line
DL CSI M {Pn} Delete Line
DCH CSI P {Pn} Delete Character
CPR CSI R {Pn;Pn} Cursor Position Report
ECH CSI X {Pn} Erase Character
DA CSI c {Pn} Device Attributes Request
VPA CSI d {Pn} Vertical Position Absolute
HVP CSI f {Pn;Pn} Horizontal and Vertical Position
TBC CSI g {Ps} Tabulation Clear
SM CSI h {Ps;...} Set Mode
MC CSI i {Pn} Media Copy
RM CSI l {Ps;...} Reset Mode
SGR CSI m {Ps;...} Select Graphic Rendition
DSRREQ CSI n {Ps} Device Status Report
DSRREP CSI n {Status} Device Status Report Reply
DECLL CSI q {Ps;...} Load LEDs
DECSTBM CSI r {Pn;Pn} Set Top and Bottom Margins
DECREQTPARM CSI x {Ps} Request Terminal Parameters
DECREPTPARM CSI x {sol;par;nbits;xspd;rspd;cmul;flags} Report Terminal Parameters
DECTST CSI y {2;Ps} Invoke Confidence Test

CTL codes

NUL CTL @ Null
SOH CTL A Start Of Heading
STX CTL B Start Of Text
ETX CTL C End Of Text
EOT CTL D End Of Transmission
ENQ CTL E Enquiry
ACK CTL F Acknowledge
BEL CTL G Bell
BS CTL H Back Space
HT CTL I Horizontal Tabulation
LF CTL J Line Feed
VT CTL K Vertical Tabulation
FF CTL L Form Feed
CR CTL M Carriage Return
LS0 CTL N Lock Shift Zero (Shift Out - SO)
LS1 CTL O Lock Shift One (Shift In - SI)
DLE CTL P Data Link Escape
DC1 CTL Q Device Control One
DC2 CTL R Device Control Two
DC3 CTL S Device Control Three
DC4 CTL T Device Control Four
NAK CTL U Negative Acknowledge
SYN CTL V Synchronous Idle
ETB CTL W End Of Transmission Block
CAN CTL X Cancel
EM CTL Y End Of Medium
SUB CTL Z Substitute
ESC CTL [ Escape
FS CTL \ File Separator (IS4 - Information Separator Four)
GS CTL ] Group Separator (IS3 - Information Separator Three)
RS CTL ^ Record Separator (IS2 - Information Separator Two)
US CTL _ Unit Separator (IS1 - Information Separator One)

DEL codes

DEL DEL Delete Character

ESC codes

DECSC ESC 7 Save Cursor
DECRC ESC 8 Restore Cursor
VT52ANSI ESC < VT52 ANSI Ansi Mode
VT52KPAM ESC = VT52 Enter alternate keypad mode
VT52KPNM ESC > VT52 Exit alternate keypad mode
VT52CUU ESC A VT52 Cursor Up
VT52CUD ESC B VT52 Cursor Down
VT52CUF ESC C VT52 Cursor Forward
VT52CUB ESC D VT52 Cursor Back
NEL ESC E Next Line
VT52SCSF ESC F VT52 Select special graphics character set
VT52SCSG ESC G VT52 Select ASCII character set
HTS ESC H Horizontal Tab Set
VT52RI ESC I VT52 Reverse Index
VT52EDS ESC J VT52 Clear To End Of Screen
VT52EDL ESC K VT52 Clear To End Of Line
RI ESC M Reverse Index
DECID ESC Z Identify Terminal
RIS ESC c Reset to Initial State
LS2 ESC n Lock Shift Two
LS3 ESC o Lock Shift Three

HSH codes

DECDHLT HSH 3 Double Height Line (Top)
DECDHLB HSH 4 Double Height Line (Bottom)
DECSWL HSH 5 Single-width Line
DECDWL HSH 6 Double Width Line
DECALN HSH 8 Screen Alignment Display

PRI codes

DECDA PRI c {1;Pn} Device Attributes Reply
DECSET PRI h {Ps;...} DEC Private Set Mode
DECRST PRI l {Ps;...} DEC Private Reset Mode
XTERESTORE PRI r {Ps;...} XTerm Private Restore Mode
XTESAVE PRI s {Ps;...} XTerm Private Save Mode

PRN codes

PRINT PRN {0x20..0x7e,0xa0..0xff} Printable Characters

SCS codes

SCS SCS {Pc;Cs} Select Character Set

VT5 codes

VT52CUP VT5 {X;Y} VT52 Cursor Position

Host to Terminal (Instructions by Group)

Commands (Character Display Operation)

PRINT PRN {0x20..0x7e,0xa0..0xff} Printable Characters

Commands (Rendition related status)

LS0 CTL N Lock Shift Zero (Shift Out - SO)
LS1 CTL O Lock Shift One (Shift In - SI)
LS2 ESC n Lock Shift Two
LS3 ESC o Lock Shift Three
SCS SCS {Pc;Cs} Select Character Set
SGR CSI m {Ps;...} Select Graphic Rendition

Commands (Cursor)

BS CTL H Back Space
CHA CSI G {Pn} Cursor Horizontal Absolute
CR CTL M Carriage Return
CUB CSI D {Pn} Cursor Backward
CUD CSI B {Pn} Cursor Down
CUF CSI C {Pn} Cursor Foreward
CUP CSI H {Pn;Pn} Cursor Position
CUU CSI A {Pn} Cursor Up
FF CTL L Form Feed
HT CTL I Horizontal Tabulation
HVP CSI f {Pn;Pn} Horizontal and Vertical Position
IND ESC D Index
LF CTL J Line Feed
NEL ESC E Next Line
RI ESC M Reverse Index
VPA CSI d {Pn} Vertical Position Absolute
VT CTL K Vertical Tabulation

Commands (Cursor related status)

DECRC ESC 8 Restore Cursor
DECSC ESC 7 Save Cursor
DECSTBM CSI r {Pn;Pn} Set Top and Bottom Margins
HTS ESC H Horizontal Tab Set
TBC CSI g {Ps} Tabulation Clear

Commands (Edit)

DCH CSI P {Pn} Delete Character
DL CSI M {Pn} Delete Line
ECH CSI X {Pn} Erase Character
ED CSI J {Ps} Erase in Display
EL CSI K {Ps} Erase in Line
ICH CSI @ {Pn} Insert Character
IL CSI L {Pn} Insert Line

Commands (Miscellaneous)

BEL CTL G Bell
CAN CTL X Cancel
DECALN HSH 8 Screen Alignment Display
DECTST CSI y {2;Ps} Invoke Confidence Test
SUB CTL Z Substitute

Commands (General mode setting)

DECRST PRI l {Ps;...} DEC Private Reset Mode
DECSET PRI h {Ps;...} DEC Private Set Mode
RM CSI l {Ps;...} Reset Mode
SM CSI h {Ps;...} Set Mode
XTERESTORE PRI r {Ps;...} XTerm Private Restore Mode
XTESAVE PRI s {Ps;...} XTerm Private Save Mode

Commands (Miscellaneous status)

DECKPAM ESC = Keypad Application Mode
DECKPNM ESC > Keypad Numeric Mode
RIS ESC c Reset to Initial State
VT52ANSI ESC < VT52 ANSI Ansi Mode

Commands (VT52)

VT52CUB ESC D VT52 Cursor Back
VT52CUD ESC B VT52 Cursor Down
VT52CUF ESC C VT52 Cursor Forward
VT52CUH ESC H VT52 Cursor Home
VT52CUP VT5 {X;Y} VT52 Cursor Position
VT52CUU ESC A VT52 Cursor Up
VT52EDL ESC K VT52 Clear To End Of Line
VT52EDS ESC J VT52 Clear To End Of Screen
VT52KPAM ESC = VT52 Enter alternate keypad mode
VT52KPNM ESC > VT52 Exit alternate keypad mode
VT52REP ESC Z VT52 Report Terminal Type
VT52RI ESC I VT52 Reverse Index
VT52SCSF ESC F VT52 Select special graphics character set
VT52SCSG ESC G VT52 Select ASCII character set

Commands (Not implemented)

DECDHLB HSH 4 Double Height Line (Bottom)
DECDHLT HSH 3 Double Height Line (Top)
DECDWL HSH 6 Double Width Line
DECLL CSI q {Ps;...} Load LEDs
DECSWL HSH 5 Single-width Line
MC CSI i {Pn} Media Copy

Commands (Ignored)

ACK CTL F Acknowledge
DC2 CTL R Device Control Two
DC3 CTL S Device Control Three
DC4 CTL T Device Control Four
DEL DEL Delete Character
DLE CTL P Data Link Escape
EM CTL Y End Of Medium
EOT CTL D End Of Transmission
ETB CTL W End Of Transmission Block
ETX CTL C End Of Text
FS CTL \ File Separator (IS4 - Information Separator Four)
GS CTL ] Group Separator (IS3 - Information Separator Three)
NAK CTL U Negative Acknowledge
NUL CTL @ Null
RS CTL ^ Record Separator (IS2 - Information Separator Two)
SOH CTL A Start Of Heading
STX CTL B Start Of Text
SYN CTL V Synchronous Idle
US CTL _ Unit Separator (IS1 - Information Separator One)

Commands (Requests)

DA CSI c {Pn} Device Attributes Request
DECID ESC Z Identify Terminal
DECREQTPARM CSI x {Ps} Request Terminal Parameters
DSRREQ CSI n {Ps} Device Status Report
ENQ CTL E Enquiry

Terminal to Host

Replies

CPR CSI R {Pn;Pn} Cursor Position Report
DECDA PRI c {1;Pn} Device Attributes Reply
DECREPTPARM CSI x {sol;par;nbits;xspd;rspd;cmul;flags} Report Terminal Parameters
DSRREP CSI n {Status} Device Status Report Reply

Events

CUB CSI D {Pn} Cursor Backward
CUD CSI B {Pn} Cursor Down
CUF CSI C {Pn} Cursor Foreward
CUU CSI A {Pn} Cursor Up
KEYBOARD Keyboard Events
MOUSE Mouse Events

Modes

Modes

DECANM ANSI/VT52 Mode
DECARM Auto Repeat Mode
DECAWM Autowrap Mode
DECCKM Cursor Keys Mode
DECCOLM Column Mode
DECINLM Interlace Mode
DECKPAM ESC = Keypad Application Mode
DECKPNM ESC > Keypad Numeric Mode
DECOM Origin Mode
DECRC ESC 8 Restore Cursor
DECRST PRI l {Ps;...} DEC Private Reset Mode
DECSC ESC 7 Save Cursor
DECSCLM Scrolling Mode
DECSCNM Screen Mode
DECSET PRI h {Ps;...} DEC Private Set Mode
DECSTBM CSI r {Pn;Pn} Set Top and Bottom Margins
HTS ESC H Horizontal Tab Set
LNM Line Feed/New Line Mode
LS0 CTL N Lock Shift Zero (Shift Out - SO)
LS1 CTL O Lock Shift One (Shift In - SI)
LS2 ESC n Lock Shift Two
LS3 ESC o Lock Shift Three
RIS ESC c Reset to Initial State
RM CSI l {Ps;...} Reset Mode
SCS SCS {Pc;Cs} Select Character Set
SGR CSI m {Ps;...} Select Graphic Rendition
SM CSI h {Ps;...} Set Mode
TBC CSI g {Ps} Tabulation Clear
VT52ANSI ESC < VT52 ANSI Ansi Mode
XTERESTORE PRI r {Ps;...} XTerm Private Restore Mode
XTESAVE PRI s {Ps;...} XTerm Private Save Mode

Appendix A - Notion Details

The following text is a collection of several sorts of definitions and explainations. It is incomplete in many respects and a working draft. .

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:

ACK Acknowledge VT100 XTERM Linux KONSOLE

0x06

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

BEL Bell VT100

0x07

Sound bell

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100guiBellsee above

BS Back Space VT100

0x08

Move cursor to the left one position, unless it is at the left margin, in which case no action is taken.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrBackSpacesee above

CAN Cancel VT100

0x18

If sent during a control sequence, the sequence id immediately terminated and not executed. It also causes the error character (checkerboard) to be displayed.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrShowCharacter2see above

CHA Cursor Horizontal Absolute ECMA KONSOLE

ESC [ Pn G

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AxtermscrsetCursorXpsee above

CPR Cursor Position Report ECMA VT100

ESC [ Pn;Pn R Default: 1 1

The CPR sequence reports the active position by means of the parameters. This sequence has two parameter values, the first specifying the line and the second specifying the column. The default condition with no parameters present, or parameters of 0, is equivalent to a cursor at home position.

The numbering of the lines depends upon the state of the Origin Mode (DECOM).

This control sequence is sent in reply to a device status report (DSRREQ) command sent from the host.

CR Carriage Return VT100

0x0d

Move the cursor to the left margin of the current line.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrReturnsee above

CUB Cursor Backward ECMA VT100

ESC [ Pn D Default: 1

Moves the cursor to the left. The distance moved is determined by the parameter. If the parameter missing, zero, or one, the cursor is moved one position. The cursor cannot be moved past the left margin.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrcursorLeftpsee above

CUD Cursor Down ECMA VT100

ESC [ Pn B Default: 1

Moves the cursor down a number of lines as specified in the parameter without changing columns. The cursor cannot be moved past the bottom margin.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrcursorDownpsee above

CUF Cursor Foreward ECMA VT100

ESC [ Pn C Default: 1

Moves the cursor to the right a number of positions specified in the parameter. The cursor cannot be moved past the right margin.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrcursorRightpsee above

CUP Cursor Position ECMA VT100

ESC [ Pn;Pn H Default: 1 1

Moves the curor to the position specified by the parameters. The first parameter specifies the line, and the second specifies the column. A value of zero for either line or column moves the cursor to the first line or column in the display. The default string (<ESC>H) homes the cursor. In the VT100, this command behaves identically to it's format effector counterpart, HVP.

The numbering of the lines depends upon the state of the Origin Mode (DECOM).

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrsetCursorYXp,qsee above

CUU Cursor Up ECMA VT100

ESC [ Pn A Default: 1

Moves the cursor up without changing columns. The cursor is moved up a number of lines as indicated by the parameter. The cursor cannot be moved beyond the top margin.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrcursorUppsee above

DA Device Attributes Request ECMA VT100

ESC [ Pn c Default: 0

The host requests the VT100 to send a DA sequence to indentify itself. This is done by sending the DA sequence with no parameters, or with a parameter of zero. The device replies by (DECDA).

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emureportTerminalTypesee above

DC1 Device Control One VT100

0x11

Causes terminal to resume transmission (XON).

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

DC2 Device Control Two VT100 XTERM Linux KONSOLE

0x12

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

DC3 Device Control Three VT100 XTERM Linux KONSOLE

0x13

Causes terminal to stop transmitting all codes except XOFF and XON (XOFF).

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

DC4 Device Control Four VT100 XTERM Linux KONSOLE

0x14

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

DCH Delete Character ECMA KONSOLE

ESC [ Pn P

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AxtermscrdeleteCharspsee above

DECALN Screen Alignment Display VT100

ESC # 8

Causes the VT100 to fill it's screen with uppercase Es for screen focus and alignment.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrhelpAlignsee above

DECANM ANSI/VT52 Mode VT100

This is a private parameter to the SM and RM control sequences. The reset state causes only VT52 compatible escape sequences to be recognized. The set state causes only ANSI compatible escape sequences to be recognized. See the entries for MODES, SM, RM and VT52ANSI.

DECARM Auto Repeat Mode VT100

This is a private parameter to the SM and RM control sequences. The reset state causes no keyboard keys to auto-repeat, the set state causes most of them to. See MODES, SM and RM.

DECAWM Autowrap Mode VT100

This is a private parameter to the SM and RM control sequences. The reset state prevents the cursor from moving when characters are recieved while at the right margin. The set state causes these characters to advance to the next line, causing a scroll up if required and permitted. See MODES, SM, and RM.

DECCKM Cursor Keys Mode VT100

This is a private parameter to the SM and RM control requences. This mode is only effective when the terminal is in keypad application mode (DECKPAM) and the ANSI/VT52 mode (DECANM) is set. Under these conditions, if this mode is reset, the cursor keys will send ANSI cursor control commands. If setm the cursor keys will send application function commands. See MODES, RM, and SM.

DECCOLM Column Mode VT100

This is a private parameter to the SM and RM control sequences. The reset state causes an 80 column screen to be used. The set state causes a 132 column screen to be used. See MODES, RM, and SM.

DECDA Device Attributes Reply VT100

ESC [ ? 1;Pn c

Response to the DA request (VT100 to host) is generated by the VT100 as a DECDA control sequence with the numeric parameters as follows:

PnMeaning
0No options
1Processor Option (STP)
2Advanced Video Option (AVO)
3AVO and STP
4Graphics Option (GPO)
5GPO and STP
6GPO and AVO

DECDHLB Double Height Line (Bottom) VT100

ESC # 4

This sequence cause the line containing the cursor to become the bottom half of a double-height, double width line. If the line was single width single height, all characters to the right of the center of the screen will be lost. The cursor remains over the same character position, unless it would be to the right of the right margin, in which case it is moved to the right margin.

DECDHLB and DECDHLT should be used in pairs on adjacent lines with each line containing the same character string.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

DECDHLT Double Height Line (Top) VT100

ESC # 3

Cause the line containing the cursor to become the top half of a double-height, double width line. If the line was single width single height, all characters to the right of the center of the screen will be lost. The cursor remains over the same character position, unless it would be to the right of the right margin, in which case it is moved to the right margin.

DECDHLB and DECDHLT should be used in pairs on adjacent lines with each line containing the same character string.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

DECDWL Double Width Line VT100

ESC # 6

This causes the line that contains the cursor to become double-width single height. If the line was single width, all characters ro the right of the center of the screen will be lost. The cursor remains over the same character position, unless it would be to the right of the right margin, in which case it is moved to the right margin.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

DECID Identify Terminal VT100

ESC Z

This sequence causes the same response as the DA sequence. This sequence will not be supported in future models.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emureportTerminalTypesee above

DECINLM Interlace Mode VT100

This is a private parameter to the RM and SM control sequences. The reset state (non-interlace) causes the video processor to display 240 scan lines per frame. The set state causes the video processor to display 480 scan lines per screen. See MODES, RM, and SM.

DECKPAM Keypad Application Mode VT100

ESC =

The auxiliary keypad keys will transmit control sequences.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emusetModeMODE_AppKeyPadsee above

DECKPNM Keypad Numeric Mode VT100

ESC >

The auxiliary keypad keys will send ASCII codes corresponding to the characters engraved on their keys.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuresetModeMODE_AppKeyPadsee above

DECLL Load LEDs VT100

ESC [ Ps;... q Default: 0

Load the four programmable LEDs on the keyboard according to the parameter(s).

SubcodeEmulationScopeOperationArgsMeaning
0VT100emuIgnoreClear all LEDs
1VT100emuIgnoreLight LED 1
2VT100emuIgnoreLight LED 2
3VT100emuIgnoreLight LED 3
4VT100emuIgnoreLight LED 4

DECOM Origin Mode VT100

This is a private parameter to SM and RM control sequences. The reset state causes the origin (or home position) to be the upper left character position of the screen. Line and column numbers are, therefore, independent of current margin settings. The cursor may be positioned outside the margins with a cursor position (CUP) or horizontal and vertical position (HVP) control.

The set state causes the origin to be at the upper left character position within the current margins. Line and column numbers are, therefore, relative to the current margin settings. The cursor cannot be positioned outside of the margins.

The cursor is moved to the new home position when this mode is set or reset. Lines and columns are numbered consecutively, with the origin being line 1, column 1.

DECRC Restore Cursor VT100

ESC 8

This sequence causes the previously saved cursor position, graphic rendition, and character set to be restored.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrrestoreCursorsee above

DECREPTPARM Report Terminal Parameters ECMA VT100

ESC [ sol;par;nbits;xspd;rspd;cmul;flags x

This sequence is generated by the VT100 to notify the host of the status of selected terminal parameters. The status sequence may be sent when requested by the host (via DECREQTPARM) or at the terminal's discretion. On power up or reset, the VT100 is inhibited from sending unsolicited reports.

The meanings of the sequence paramters are:

cmulMeaning
1The bit rate multiplier is 16

flagsMeaning
0-15This value communicates the four switch values in block 5 of SET-UP B, which are only visible to the user when an STP option is installed.

nbitsMeaning
18 bits per character
27 bits per character

parMeaning
1No parity set
4Parity set and odd
5Parity set and even

solMeaning
1This message is a report.
2This message is a report, and the terminal is only reporting on request.

speedMeaning (xspd,rspd)
0Speed set to 50 bps
8Speed set to 75 bps
16Speed set to 110 bps
24Speed set to 134.5 bps
32Speed set to 150 bps
40Speed set to 200 bps
48Speed set to 300 bps
56Speed set to 600 bps
64Speed set to 1200 bps
72Speed set to 1800 bps
80Speed set to 2000 bps
88Speed set to 2400 bps
96Speed set to 3600 bps
104Speed set to 4800 bps
112Speed set to 9600 bps
120Speed set tp 19200 bps

DECREQTPARM Request Terminal Parameters ECMA VT100

ESC [ Ps x

The host sends this sequence to request the VT100 to send a DECREPTPARM sequence back. {Ps} can be either 0 or 1. If 0, the terminal will be allowed to send unsolicited DECREPTPARMs. These reports will be generated each time the terminal exits the SET-UP mode. If {Ps} is 1, then the terminal will only generate DECREPTPARMs in response to a request.

SubcodeEmulationScopeOperationArgsMeaning
0VT100emureportTerminalParms2Meaning
1VT100emureportTerminalParms3Meaning

DECRST DEC Private Reset Mode VT100 KONSOLE

ESC [ ? Ps;... l

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
1VT100emuresetModeMODE_AppCuKeysMeaning
2VT100emuresetModeMODE_AnsiMeaning
3VT100emusetColumns80Meaning
4VT100emuIgnoredMeaning
5VT100scrresetModeMODE_ScreenMeaning
6VT100scrresetModeMODE_OriginMeaning
7VT100scrresetModeMODE_WrapMeaning
8VT100emuIgnoredMeaning
9VT100emuIgnoredMeaning
25VT100emuresetModeMODE_CursorMeaning
47xtermemuresetModeMODE_AppScreenMeaning
1000xtermemuresetModeMODE_Mouse1000Meaning
1001xtermemuIgnoredMeaning
1047xtermemuresetModeMODE_AppScreenMeaning
1048xtermscrrestoreCursorMeaning

DECSC Save Cursor VT100

ESC 7

Causes the cursor position, graphic rendition, and character set to be saved. (See DECRC)

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrsaveCursorsee above

DECSCLM Scrolling Mode VT100

This is a private parameter to RM and SM control sequences. The reset state causes scrolls to "jump" instantaneuously one line at a time. The set state causes the scrolls to be "smooth", and scrolls at a maximum rate of siz lines/sec. See MODES, RM, and SM.

DECSCNM Screen Mode VT100

This is a private parameter to RM and SM control sequences. The reset state causes the screen to be black with white characters; the set state causes the screen to be white with black characters. See MODES, RM, and SM.

DECSET DEC Private Set Mode VT100 KONSOLE

ESC [ ? Ps;... h

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
1VT100emusetModeMODE_AppCuKeysMeaning
3VT100emusetColumns132Meaning
4VT100emuIgnoredMeaning
5VT100scrsetModeMODE_ScreenMeaning
6VT100scrsetModeMODE_OriginMeaning
7VT100scrsetModeMODE_WrapMeaning
8VT100emuIgnoredMeaning
9VT100emuIgnoredMeaning
25VT100emusetModeMODE_CursorMeaning
47xtermemusetModeMODE_AppScreenMeaning
1000xtermemusetModeMODE_Mouse1000Meaning
1001xtermemuIgnoredMeaning
1047xtermemusetModeMODE_AppScreenMeaning
1048xtermscrsaveCursorMeaning

DECSTBM Set Top and Bottom Margins VT100

ESC [ Pn;Pn r Default: 1 ScreenLines

This sequence sets the top and bottom margins to define the scrolling region. The first parameter is the line number of the first line in the scrolling region; the second parameter is the line number of the bottom line of the scrolling region.

Default is the entire screen (no margins). The minimum region allowed is two lines, i.e., the top line must be less than the bottom. The cursor is placed in the home position (See DECOM).

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrsetMarginsp,qsee above

DECSWL Single-width Line VT100

ESC # 5

This causes the line which contains the cursor to become single-width, single-height. The cursor remains on the same character position. This is the default condition for all new lines on the screen.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

DECTST Invoke Confidence Test ECMA VT100

ESC [ 2;Ps y

Ps is the parameter indicating the test to be done. It is computed by taking the weight indicated for each desired test and adding them together. If Ps is 0, no test is performed but the VT100 is reset.

WeightMeaning
1POST (ROM checksum, RAM NVR, keyboardm and AVO)
2Data Loop Back (Loopback connector required)
3EIA Modem Control Test (Loopback connector req.)
4Repeat Testing until failure

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

DEL Delete Character VT100

0x7f

Ignored

DL Delete Line ECMA KONSOLE

ESC [ Pn M

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AkonsolescrdeleteLinespsee above

DLE Data Link Escape VT100 XTERM Linux KONSOLE

0x10

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

DSRREP Device Status Report Reply ECMA VT100

ESC [ Status n

Reports the general status of the VT100 according to the following parameters.

DSRREP with a parameter of 0 or 3 is always sent as a response to a requesting DSRREQ with a parameter of 5.

StatusMeaning
0Ready, no faults detected
3Malfunction detected

DSRREQ Device Status Report ECMA VT100

ESC [ Ps n

Requests status of the VT100 according to the following parameters.

SubcodeEmulationScopeOperationArgsMeaning
5VT100emureportStatusReport Status (using a DSRREP control sequence)
6VT100emureportCursorPositionReport Active Position (using a CPR sequence)

ECH Erase Character ECMA KONSOLE

ESC [ Pn X

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AkonsolescreraseCharspsee above

ED Erase in Display ECMA VT100

ESC [ Ps J Default: 0

This sequence erases some or all of the characters in the display according to the parameter. Any complete line erased by this sequence will return that line to single width mode.

SubcodeEmulationScopeOperationArgsMeaning
0VT100scrclearToEndOfScreenErase from the cursor to the end of the screen.
1VT100scrclearToBeginOfScreenErase from the start of the screen to the cursor.
2VT100scrclearEntireScreenErase the entire screen.

EL Erase in Line ECMA VT100

ESC [ Ps K Default: 0

Erases some or all characters in the active line, according to the parameter.

SubcodeEmulationScopeOperationArgsMeaning
0VT100scrclearToEndOfLineErase from cursor to the end of the line.
1VT100scrclearToBeginOfLineErase from the start of the line to the cursor.
2VT100scrclearEntireLineErase the entire line.

EM End Of Medium VT100 XTERM Linux KONSOLE

0x19

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

ENQ Enquiry VT100

0x05

Transmit the ANSWERBACK message. The answerback message can be loaded in SET-UP B (i.e. is a configurable string).

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emureportAnswerBacksee above

EOT End Of Transmission VT100 XTERM Linux KONSOLE

0x04

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

ESC Escape ECMA VT100

0x1b

Introduces a control sequence.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

ETB End Of Transmission Block VT100 XTERM Linux KONSOLE

0x17

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

ETX End Of Text VT100 XTERM Linux KONSOLE

0x03

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

FF Form Feed VT100

0x0c

Same as LF.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuNewLinesee above

FS File Separator (IS4 - Information Separator Four) VT100 XTERM Linux KONSOLE

0x1c

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

GS Group Separator (IS3 - Information Separator Three) VT100 XTERM Linux KONSOLE

0x1d

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

HT Horizontal Tabulation VT100

0x09

Move cursor to the next tab stop, or to the right margin if no further tabs are set.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrTabulatesee above

HTS Horizontal Tab Set ECMA VT100

ESC H

Set a tab stop at the current cursor position.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrchangeTabStopTRUEsee above

HVP Horizontal and Vertical Position ECMA VT100

ESC [ Pn;Pn f Default: 1 1

Moves the cursor to the position specified by the parameters. The first parameter specifies the line, and the second specifies the column. A parameter of 0 or 1 causes the active position to move to the first line or column in the display. In the VT100, this control behaves identically with it's editor counterpart, CUP. The numbering of hte lines depends upon the state of the Origin Mode (DECOM).

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrsetCursorYXp,qsee above

ICH Insert Character ECMA KONSOLE

ESC [ Pn @

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AkonsolescrinsertCharspsee above

IL Insert Line KONSOLE

ESC [ Pn L

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AxtermscrinsertLinespsee above

IND Index ECMA VT100

ESC D

This sequence causes the cursor to move downward one line without changing the column. If the cursor is at the bottom margin, a scroll up is performed.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrindexsee above

KEYBOARD Keyboard Events KONSOLE

FIXME. explain

KeyCode
AltButton"\033"
ReturnMODE_NewLine ? "\r\n" : "\r"
BackspaceMODE_BsHack ? "\x7f" : "\x08"
DeleteMODE_BsHack ? "\033[3~" : "\x7f"
Up!MODE_Ansi ?"\033A" : MODE_AppCuKeys ?"\033OA" : "\033[A"
Down!MODE_Ansi ?"\033B" : MODE_AppCuKeys ?"\033OB" : "\033[B"
Right!MODE_Ansi ?"\033C" : MODE_AppCuKeys ?"\033OC" : "\033[C"
Left!MODE_Ansi ?"\033D" : MODE_AppCuKeys ?"\033OD" : "\033[D"
F1Xterm? "\033[11~": "\033[[A"
F2Xterm? "\033[12~": "\033[[B"
F3Xterm? "\033[13~": "\033[[C"
F4Xterm? "\033[14~": "\033[[D"
F5Xterm? "\033[15~": "\033[[E"
F6"\033[17~"
F7"\033[18~"
F8"\033[19~"
F9"\033[20~"
F10"\033[21~"
F11"\033[23~"
F12"\033[24~"
Home"\033[7~"
End"\033[8~"
Prior"\033[5~"
Next"\033[6~"
Insert"\033[2~"
Control_Space"\x00"
Control_PrintreportAnswerBack()
AsciiCharacter

LF Line Feed VT100

0x0a

Causes either a line feed or new line operation (See LNM.)

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuNewLinesee above

LNM Line Feed/New Line Mode ECMA VT100

This is a parameter to SM and RM control sequences. The reset state causes the interpretation of the LF character to imply only vertical movement of the cursor and causes the RETURN key to send the single code CR.

The set state causes the LF character to imply movement to the first position of the following line, and causes the RETURN key to send the code pair CR LF. This is the New Line option.

This mode does not affect the Index (IND) or the next line (NEL) format effectors.

LS0 Lock Shift Zero (Shift Out - SO) VT100

0x0e

Invoke the G1 character set, as designated by the SCS control sequence.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scruseCharset1see above

LS1 Lock Shift One (Shift In - SI) VT100

0x0f

Invoke the G0 character set, as selected by the <ESC>( sequence.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scruseCharset0see above

LS2 Lock Shift Two KONSOLE

ESC n

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AxtermscruseCharset2see above

LS3 Lock Shift Three KONSOLE

ESC o

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AxtermscruseCharset3see above

MC Media Copy ECMA VT100

ESC [ Pn i

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
0VT100emuIgnoredMeaning

MOUSE Mouse Events KONSOLE

FIXME. explain

NAK Negative Acknowledge VT100 XTERM Linux KONSOLE

0x15

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

NEL Next Line ECMA VT100

ESC E

This causes the cursor to move to the first position of the next line down. If the cursor is on the bottom line, a scroll is performed.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrNextLinesee above

NUL Null VT100 XTERM Linux KONSOLE

0x00

NUL is used as media- or time-fill. It is ignored by Konsole, but may be sensible for devices which requiere a recognizable amount of time to complete some commands (e.g. form feed on a non-buffering printing device).

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

PRINT Printable Characters ECMA VT100

0x20..0x7e,0xa0..0xff

Printable characters are basically displayed. They my cause a line wrap when the cursor is already located at the end of the line.

The VT100 has a unique way to do this by producing a line wrap before the character would be displayed on the next line. This feature allows to print at the rightmost column without producing an implicit line feed.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrShowCharacterpsee above

RI Reverse Index ECMA VT100

ESC M

Move the cursor up one line without changing columns. If the cursor is on the top line, a scroll down is performed.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrreverseIndexsee above

RIS Reset to Initial State ECMA VT100

ESC c

Resets the VT100 to the state is has upon power up. This also causes the execution of the POST and signal INT H to be asserted briefly.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuresetTerminalsee above

RM Reset Mode ECMA VT100

ESC [ Ps;... l

Resets one or more VT100 modes as specified by each selective parameter in the parameter string. Each mode to be reset is specified by a separate parameter. See MODES and SM.

SubcodeEmulationScopeOperationArgsMeaning
4xtermscrresetModeMODE_InsertMeaning
20VT100emuresetModeMODE_NewLineLNM

RS Record Separator (IS2 - Information Separator Two) VT100 XTERM Linux KONSOLE

0x1e

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

SCS Select Character Set ECMA VT100

ESC Pc;Cs

The appropriate D0 and G1 character sets are designated from one of the five possible sets. The G0 and G1 sets are invoked by the characters LS1 and LS0, respectively.

The United Kingdom and ASCII sets conform to the "ISO international register of character sets to be used with escape sequences". The other sets are private character sets. Special graphics means that the graphic characters fpr the codes 0137 to 0176 are replaced with other characters. The specified character set will be used until another SCS is recieved.

CsCharacter Set
AUnited Kingdom Set
BASCII Set
0Special Graphics
1Alternate Character ROM (Standard Character Set)
2Alternate Character ROM (Special Graphics)

PcCharacter Selection
(Select G0 Set
)Select G1 Set

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emusetCharsetp-'(',qsee above

SGR Select Graphic Rendition ECMA VT100

ESC [ Ps;... m

Invoke the graphic rendition specified by the parameter(s). All following characters transmitted to the VT100 are rendered according to the parameter(s) until the next occurrence of an SGR.

All other parameter values are ignored.

Without the Advanced Video Option, only one type of character attribute is possible, as determined by the cursor selection; in that case specifying either underscore or reverse will activate the currently selected attribute.

SubcodeEmulationScopeOperationArgsMeaning
0VT100scrsetDefaultRenditionAttributes Off
1VT100scrsetRenditionRE_BOLDBold or increased intensity
4VT100scrsetRenditionRE_UNDERLINEUnderscore
5VT100scrsetRenditionRE_BLINKBlink
7VT100scrsetRenditionRE_REVERSENegative (reverse) image
10konsoleemuIgnoredMeaning
11konsoleemuIgnoredMeaning
12konsoleemuIgnoredMeaning
22VT100scrresetRenditionRE_BOLDMeaning
24VT100scrresetRenditionRE_UNDERLINEMeaning
25VT100scrresetRenditionRE_BLINKMeaning
27VT100scrresetRenditionRE_REVERSEMeaning
30xtermscrsetForeColor0Meaning
31xtermscrsetForeColor1Meaning
32xtermscrsetForeColor2Meaning
33xtermscrsetForeColor3Meaning
34xtermscrsetForeColor4Meaning
35xtermscrsetForeColor5Meaning
36xtermscrsetForeColor6Meaning
37xtermscrsetForeColor7Meaning
39xtermscrsetForeColorToDefaultMeaning
40xtermscrsetBackColor0Meaning
41xtermscrsetBackColor1Meaning
42xtermscrsetBackColor2Meaning
43xtermscrsetBackColor3Meaning
44xtermscrsetBackColor4Meaning
45xtermscrsetBackColor5Meaning
46xtermscrsetBackColor6Meaning
47xtermscrsetBackColor7Meaning
49xtermscrsetBackColorToDefaultMeaning
90xtermscrsetForeColor8Meaning
91xtermscrsetForeColor9Meaning
92xtermscrsetForeColor10Meaning
93xtermscrsetForeColor11Meaning
94xtermscrsetForeColor12Meaning
95xtermscrsetForeColor13Meaning
96xtermscrsetForeColor14Meaning
97xtermscrsetForeColor15Meaning
100xtermscrsetBackColor8Meaning
101xtermscrsetBackColor9Meaning
102xtermscrsetBackColor10Meaning
103xtermscrsetBackColor11Meaning
104xtermscrsetBackColor12Meaning
105xtermscrsetBackColor13Meaning
106xtermscrsetBackColor14Meaning
107xtermscrsetBackColor15Meaning

SM Set Mode ECMA VT100

ESC [ Ps;... h

Causes one or more modes to be set within the VT100 as specified by each selective parameter string. Each mode to be set is specified by a seperate parameter. A mode is considered set until it is reset by a Reset Mode (RM) control sequence. See RM and MODES.

SubcodeEmulationScopeOperationArgsMeaning
4VT100scrsetModeMODE_InsertMeaning
20VT100emusetModeMODE_NewLineLNM

SOH Start Of Heading VT100 XTERM Linux KONSOLE

0x01

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

STX Start Of Text VT100 XTERM Linux KONSOLE

0x02

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

SUB Substitute VT100

0x1a

Same as CAN.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100scrShowCharacter2see above

SYN Synchronous Idle VT100 XTERM Linux KONSOLE

0x16

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

TBC Tabulation Clear ECMA VT100

ESC [ Ps g

If the parameter is missing or 0, this will clear the tab stop at the cursor's position. If it is 3, this will clear all of the tab stops. Any other parameter is ignored.

SubcodeEmulationScopeOperationArgsMeaning
0VT100scrchangeTabStopFALSEMeaning
3VT100scrclearTabStopsMeaning

US Unit Separator (IS1 - Information Separator One) VT100 XTERM Linux KONSOLE

0x1f

Ignored

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuIgnoredsee above

VPA Vertical Position Absolute ECMA KONSOLE

ESC [ Pn d

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AxtermscrsetCursorYpsee above

VT Vertical Tabulation VT100

0x0b

Same as LF.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT100emuNewLinesee above

VT52ANSI VT52 ANSI Ansi Mode VT100 XTERM VT52 KONSOLE

ESC <

This is an extention to the VT52 commands to embed the emulation into VT100. It allows to return back to VT100 emulation (ANSI mode). See also DECANM and SM.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52emusetModeMODE_Ansisee above

VT52CUB VT52 Cursor Back KONSOLE

ESC D

See CUB.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrcursorLeft1see above

VT52CUD VT52 Cursor Down KONSOLE

ESC B

See CUD.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrcursorDown1see above

VT52CUF VT52 Cursor Forward KONSOLE

ESC C

See CUF.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrcursorRight1see above

VT52CUH VT52 Cursor Home KONSOLE

ESC H

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrsetCursorYX1,1see above

VT52CUP VT52 Cursor Position KONSOLE

ESC Y X;Y

Line and column numbers for direct cursor address are single character codes whose values are the desired number plus 37 (in Octal). Line and column numbers start at 1.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrsetCursorYXp-31,q-31see above

VT52CUU VT52 Cursor Up KONSOLE

ESC A

See CUU.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrcursorUp1see above

VT52EDL VT52 Clear To End Of Line KONSOLE

ESC K

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrclearToEndOfLinesee above

VT52EDS VT52 Clear To End Of Screen KONSOLE

ESC J

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrclearToEndOfScreensee above

VT52KPAM VT52 Enter alternate keypad mode KONSOLE

ESC =

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52emusetModeMODE_AppKeyPadsee above

VT52KPNM VT52 Exit alternate keypad mode KONSOLE

ESC >

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52emuresetModeMODE_AppKeyPadsee above

VT52REP VT52 Report Terminal Type KONSOLE

ESC Z

Response to ESC Z is ESC / Z.

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52emureportTerminalTypesee above

VT52RI VT52 Reverse Index KONSOLE

ESC I

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrreverseIndexsee above

VT52SCSF VT52 Select special graphics character set KONSOLE

ESC F

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrsetAndUseCharset0,'0'see above

VT52SCSG VT52 Select ASCII character set KONSOLE

ESC G

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
N/AVT52scrsetAndUseCharset0,'B'see above

XTERESTORE XTerm Private Restore Mode XTERM KONSOLE

ESC [ ? Ps;... r

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
1xtermemurestoreModeMODE_AppCuKeysMeaning
6xtermscrrestoreModeMODE_OriginMeaning
7xtermscrrestoreModeMODE_WrapMeaning
1000xtermemurestoreModeMODE_Mouse1000Meaning
1001xtermemuIgnoredMeaning

XTESAVE XTerm Private Save Mode XTERM KONSOLE

ESC [ ? Ps;... s

FIXME. explain

SubcodeEmulationScopeOperationArgsMeaning
1xtermemusaveModeMODE_AppCuKeysMeaning
6xtermscrsaveModeMODE_OriginMeaning
7xtermscrsaveModeMODE_WrapMeaning
1000xtermemusaveModeMODE_Mouse1000Meaning
1001xtermemuIgnoredMeaning

On VT100

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.

Modes

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

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

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).
Octal
Code
ASCII
Graphic
Special Graphic



0137 _ Blank
0140 ` Diamond
0141 a Checkerboard
0142 b Digraph: (HT)
0143 c Digraph: (FF)
0144 d Digraph: (CR)
0145 e Digraph: (LF)
0146 f Degree Symbol: °
0147 g +/- Symbol: ±
0150 h Digraph: (NL)
0151 i Digraph: (VT)
0152 j Lower-right corner
0153 k Upper-right corner
0154 l Upper-left corner
0155 m Lower-left corner
0156 n Crossing lines (+)
Octal
Code
ASCII
Graphic
Special Graphic



0157 o Horiz Line - scan 1
0160 p Horiz Line - scan 3
0161 q Horiz Line - scan 5
0162 r Horiz Line - scan 7
0163 s Horiz Line - scan 9
0164 t Left "T" (|-)
0165 u Right "T" (-|)
0166 v Bottom "T" (|_)
0167 w Top "T" (T)
0170 x Vertical Bar (|)
0171 y Less/Equal: ≤
0172 z Graeter/Egual: ≥
0173 { Pi symbol: π
0174 | Not equal: ≠
0175 } UK pound symbol: £
0176 ~ Centered dot: ·
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