|
ANSI/VT100 Terminal ControlCopyright © 1996 Robert M. Free - all rights reserved][ Status | Setup | Fonts | Cursor | Scrolling | Tabs | Erasing | Printing | Keyboard | Colors ]Many computer terminals and terminal emulators support color and cursor control through a system of escape sequences. One such standard is commonly referred to as ANSI Color. Several terminal specifications are based on the ANSI color standard, including VT100. The following is a partial listing of the VT100 control set.
Device StatusThe following codes are used for reporting terminal/display settings, and vary depending on the implementation:Query Device Code <ESC>[c
Report Device Code response from the device.
Report Device Code <ESC>[{code}0c
Query Device Code request.
Query Device Status <ESC>[5n
Report Device Status response from the device.
Report Device OK <ESC>[0n
Query Device Status request;
indicates that device is functioning correctly.
Report Device Failure <ESC>[3n
Query Device Status request;
indicates that device is functioning improperly.
Query Cursor Position <ESC>[6n
Report Cursor Position response from the device.
Report Cursor Position <ESC>[{ROW};{COLUMN}R
Query Cursor Position request;
reports current cursor position.
Terminal SetupTheh and l codes are used for setting terminal/display
mode, and vary depending on the implementation. Line Wrap is one of the few setup codes that
tend to be used consistently:
Reset Device <ESC>c
Enable Line Wrap <ESC>[7h
Disable Line Wrap <ESC>[7l
FontsSome terminals support multiple fonts: normal/bold, swiss/italic, etc. There are a variety of special codes for certain terminals; the following are fairly standard:
Font Set G0 <ESC>(
Font Set G1 <ESC>)
Cursor ControlCursor Home <ESC>[{ROW};{COLUMN}H
<ESC>[H ),
the cursor will move to the home position, at the upper left of the screen.
Cursor Up <ESC>[{COUNT}A
Cursor Down <ESC>[{COUNT}B
Cursor Forward <ESC>[{COUNT}C
Cursor Backward <ESC>[{COUNT}D
Force Cursor Position <ESC>[{ROW};{COLUMN}f
Cursor Home .
Save Cursor <ESC>[s
Unsave Cursor <ESC>[u
Save Cursor .
Save Cursor & Attrs <ESC>7
Restore Cursor & Attrs <ESC>8
Save Cursor .
ScrollingScroll Screen <ESC>[r
Scroll Screen <ESC>[{start};{end}r
{start} to row {end} .
Scroll Down <ESC>D
Scroll Up <ESC>M
Tab ControlSet Tab <ESC>H
Clear Tab <ESC>[g
Clear All Tabs <ESC>[3g
Erasing TextErase End of Line <ESC>[K
Erase Start of Line <ESC>[1K
Erase Line <ESC>[2K
Erase Down <ESC>[J
Erase Up <ESC>[1J
Erase Screen <ESC>[2J
PrintingSome terminals support local printing:Print Screen <ESC>[i
Print Line <ESC>[1i
Stop Print Log <ESC>[4i
Start Print Log <ESC>[5i
Define KeySet Key Definition <ESC>[{key};"{string}"p
{key} indicates the key by its ASCII value in decimal.
Set Display AttributesSet Attribute Mode <ESC>[{attr1};...;{attrn}m
0 Reset all attributes 1 Bright 2 Dim 4 Underscore 5 Blink 7 Reverse 8 Hidden Foreground Colors 30 Black 31 Red 32 Green 33 Yellow 34 Blue 35 Magenta 36 Cyan 37 White Background Colors 40 Black 41 Red 42 Green 43 Yellow 44 Blue 45 Magenta 46 Cyan 47 White [ Top | Status | Setup | Fonts | Cursor | Scrolling | Tabs | Erasing | Printing | Keyboard | Colors ]For comments/correction/additions regarding this reference, email specs@graphcomp.com. |
|