X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,162629b8789983cc,start X-Google-Attributes: gidf996b,public From: Shafiq Santora Subject: here are the VT 100 terminal codes Date: 1996/02/11 Message-ID: X-Deja-AN: 139052239 organization: George Mason University, Fairfax, Virginia, USA content-type: TEXT/PLAIN; charset=US-ASCII mime-version: 1.0 newsgroups: alt.ascii-art For those of you interested in the VT100 character codes, here they are. A few of you sent me private email requests for info about how to embed ecs characters in your art, and I will get to that later. But for now, the terminal codes: ANSI/VT2xx/VT102/VT100 Control Codes and Escape Sequences ================================================================================ Set and Reset mode - all codes are prefixed with ASCII code 27 (escape) - several codes producse effects similar to DCL commands. While the immedeate effect may be the same, the VAX will not be aware of the terminal changes unless you enter the equivalent DCL command. -------------------------------------------------------------------------------- Code Effect Comments ------- ------------------------------ ----------------------------------------- [2h keyboard locked same as [2l keyboard unlocked same as [4h insert mode same as SET TERMINAL/INSERT [4l overstrike mode same as SET TERMINAL/OVERSTRIKE [12h local echo off [12l local echo on [20h new line mode on sends for key [20l new line mode off sends for key [?1h cursor keys: application [?1l cursor keys: cursor cursor keys move cursor [?2l VT52 mode same as SET TERMINAL/DEVICE_TYPE=VT52 [?3h 132 column mode same as SET TERMINAL/WIDTH=132 [?3l 80 column mode same as SET TERMINAL/WIDTH=80 [?4h smooth scrolling [?4l jump scrolling [?5h screen reverse reverses text and background colors [?5l screen normal text and background normal colors [?6h origin mode relative top of scrolling region (x,1) [?6l origin mode absolute top of screen (x,1) [?7h auto wrap on same as SET TERMINAL/WRAP [?7l auto wrap off same as SET TERMINAL/NOWRAP [?8h auto repeat on [?8l auto repeat off [?9h interlace on [?9l interlace off [?18h print form feed on same as SET TERMINAL/FORM [?18l print form feed on same as SET TERMINAL/FORM [?19h print extent full screen what is printed on local printer [?19l print extent scrolling region what is printed on local printer ================================================================================ Character Set Selection -format for character set selection is {primary}{final} where is ASCII character 27 (escape). One character each of {primary} and {final} must be included (see below). -------------------------------------------------------------------------------- {primary} Logical Character Set ----------- ----------------------- ( G0 ) G1 * G2 (VT2xx only) + G3 (VT2xx only) {final} Actual Character Set --------- ---------------------- A U.K. national (VT100/102 only) B U.S. ASCII 0 special graphics 1 alternate character set ROM (VT100/102 only) 2 alternate special graphics set ROM (VT100/102 only) < DEC international (VT2xx only) -------------------------------------------------------------------------------- Logical Character Set Selection -ASCII character 14 selects logical character set G1. ASCII character 15 selects logical character set G0 (VT100/102 only). ================================================================================ Character Attributes -the following attributes remain in effect until turned off explicitly with [m or [0m. -several codes may be sent at once by placing a semi-colon between the effect number, and placing the 'm' at the end of the entire string. For exampe, [1;5m would produce highlighted, flashing characters. -all sequences preceded by ASCII character 27 (escape). -------------------------------------------------------------------------------- Code Effect Comments ---- ------------------ -------------------------------------------------------- [m normal same as [0m - turns attributes off [0m normal same as [m - turns attributes off [1m bold/highlight [4m underline may appear as inverse text on some terminals [5m blink [7m inverse -------------------------------------------------------------------------------- Line Attributes -these sequences effect the chracters on the immedeate line. Attributes are returned to normal at then end of the line. -all sequences preceded by ASCII character 27 (escape). -------------------------------------------------------------------------------- Code Effect Comments ---- --------------------------- ----------------------------------------------- #3 double height top half prints only top half of characters #4 double height bottom half prints only bottom half of characters #5 single width, single height normal characters #6 double width, single height ================================================================================ Scrolling Region [t;br where: | Example: - ASCII character 27 (escape) | [3;14r would set up a t - top line of scrolling region | scrolling region between rows 3 b - bottom line of scrolling region | and 14 of the terminal screen. ================================================================================ Cursor Movement Commands -several of these sequences have option counts or cursor positions available. n represents a count, while l and c represent line and column numbers re- spectively. Numbers should be placed before the code letter (A, B, D, etc.). -the cursor position sequence ([l;cH or [l;cf) should not include the semi- colon unless both positions are included. If only one number is specified, it is assumed to be l (the line number). -all sequences preceded with ASCII character 27 (escape). -------------------------------------------------------------------------------- Code Effect Optional Parameters ------ ------------------ ------------------------------------------------------ [A cursor up n - number of lines to move cursor up [B cursor down n - number of lines to move cursor down [C cursor right n - number of lines to move cursor right [D cursor left n - number of lines to move cursor left [H cursor placement l - line number c - column number [f cursor placement (see above) D index (cursor down) M reverse index (cursor up) E next line 7 save cursor 8 restore cursor ================================================================================ Editing Functions -these functions effect the line or space the cursor is currently on. -n represents an optional count (e.g. [P deletes once character, while [3L inserts 3 blank lines). -all sequences preceded by ASCII character 27 (escape) -------------------------------------------------------------------------------- Code Effect ----- ---------------- [nP delete character [nL insert line [nM delete line ================================================================================ Tab Stops -all sequences preceded by ASCII character 27 (escape). -------------------------------------------------------------------------------- Code Effect ---- ------------------ H horizontal tab set [g tab clear [0g tab clear [3g clear all tabs ================================================================================ Erasing -all sequences preceded by ASCII character 27 (escape). -------------------------------------------------------------------------------- Code Effect ---- --------------------------------------------------------------------------- [K erase from cursor to end of line [0K erase from cursor to end of line [1K erase from beginning of line to cursor [2K erase entire current line [J erase from cursor to end of screen [0J erase from cursor to end of screen [1J erase from beginning of screen to cursor [2J erase entire screen ================================================================================ Miscillaneous -all sequences preceded by ASCII character 27 (escape) -------------------------------------------------------------------------------- Code Effect Comments -------- ------------------- --------------------------------------------------- c reset terminal resets terminal to default values (including such things as baud, parity, et cetera). #8 fill screen with Es terminal test [2;xy invoke tests invokes terminal test x, where x is some number. information regarding tests, and test numbers, unavailable. [0q keyboard LEDs off turns off LEDs on terminal keyboard [nq keyboard LED n on turns keyboard LED n on, where n is a number be- tween 1 and 4. Information regarding actual pur- pose of LEDs unavailable. ================================================================================ Print Commands -all sequences preceded by ASCII character 27 (escape) -------------------------------------------------------------------------------- Code Effect Comments ------- -------------------------- --------------------------------------------- [i print screen [0i print screen [4i EXIT printer controller output to terminal screen [5i ENTER printer controller output to terminal printer [?1i print cursor line [?4i EXIT auto print stop printer capture [?5i ENTER auto print start printer capture ================================================================================ _____________________________________________ | Allen Santora | | Support Center Assistant | | UCIS Support Center | | Thompson Hall, Room 3 (703) 993-8677 | | asantora@osf1.gmu.edu | ---------------------------------------------