1 <TITLE>ANSI.SYS -- ansi terminal emulation escape sequences</TITLE>
5 Defines functions that change display graphics, control cursor movement, and
6 reassign keys. The ANSI.SYS device driver supports ANSI terminal emulation
7 of escape sequences to control your system's screen and keyboard. An ANSI
8 escape sequence is a sequence of ASCII characters, the first two of which
9 are the escape character (1Bh) and the left-bracket character (5Bh). The
10 character or characters following the escape and left-bracket characters
11 specify an alphanumeric code that controls a keyboard or display function.
12 ANSI escape sequences distinguish between uppercase and lowercase letters;
13 for example,"A" and "a" have completely different meanings.
16 Parameters used in ANSI escape sequences
19 Numeric parameter. Specifies a decimal number.
22 Selective parameter. Specifies a decimal number that you use to select
23 a function. You can specify more than one function by separating the
24 parameters with semicolons.
27 Line parameter. Specifies a decimal number that represents one of the
28 lines on your display or on another device.
31 Column parameter. Specifies a decimal number that represents one of the
32 columns on your screen or on another device.
34 ANSI escape sequences for cursor movement, graphics, and keyboard settings
36 In the following list of ANSI escape sequences, the abbreviation ESC
37 represents the ASCII escape character 27 (1Bh), which appears at the
38 beginning of each escape sequence.
41 Cursor Position: Moves the cursor to the specified position
42 (coordinates). If you do not specify a position, the cursor moves to the
43 home position - the upper-left corner of the screen (line 0, column
44 0). This escape sequence works the same way as the following Cursor
45 Position escape sequence.
48 Cursor Position: Works the same way as the preceding Cursor Position
52 Cursor Up: Moves the cursor up by the specified number of lines without
53 changing columns. If the cursor is already on the top line, ANSI.SYS
54 ignores this sequence.
57 Cursor Down: Moves the cursor down by the specified number of lines
58 without changing columns. If the cursor is already on the bottom line,
59 ANSI.SYS ignores this sequence.
62 Cursor Forward: Moves the cursor forward by the specified number of
63 columns without changing lines. If the cursor is already in the
64 rightmost column, ANSI.SYS ignores this sequence.
67 Cursor Backward: Moves the cursor back by the specified number of
68 columns without changing lines. If the cursor is already in the leftmost
69 column, ANSI.SYS ignores this sequence.
72 Save Cursor Position: Saves the current cursor position. You can move
73 the cursor to the saved cursor position by using the Restore Cursor
77 Restore Cursor Position: Returns the cursor to the position stored
78 by the Save Cursor Position sequence.
81 Erase Display: Clears the screen and moves the cursor to the home
82 position (line 0, column 0).
85 Erase Line: Clears all characters from the cursor position to the
86 end of the line (including the character at the cursor position).
89 Set Graphics Mode: Calls the graphics functions specified by the
90 following values. These specified functions remain active until the next
91 occurrence of this escape sequence. Graphics mode changes the colors and
92 attributes of text (such as bold and underline) displayed on the
98 4 Underscore (on monochrome display adapter only)
123 Parameters 30 through 47 meet the ISO 6429 standard.
126 Set Mode: Changes the screen width or type to the mode specified
127 by one of the following values:
129 0 40 x 148 x 25 monochrome (text)
130 1 40 x 148 x 25 color (text)
131 2 80 x 148 x 25 monochrome (text)
132 3 80 x 148 x 25 color (text)
133 4 320 x 148 x 200 4-color (graphics)
134 5 320 x 148 x 200 monochrome (graphics)
135 6 640 x 148 x 200 monochrome (graphics)
136 7 Enables line wrapping
137 13 320 x 148 x 200 color (graphics)
138 14 640 x 148 x 200 color (16-color graphics)
139 15 640 x 148 x 350 monochrome (2-color graphics)
140 16 640 x 148 x 350 color (16-color graphics)
141 17 640 x 148 x 480 monochrome (2-color graphics)
142 18 640 x 148 x 480 color (16-color graphics)
143 19 320 x 148 x 200 color (256-color graphics)
146 Reset Mode: Resets the mode by using the same values that Set Mode
147 uses, except for 7, which disables line wrapping. The last character
148 in this escape sequence is a lowercase L.
151 Set Keyboard Strings: Redefines a keyboard key to a specified string.
152 The parameters for this escape sequence are defined as follows:
154 Code is one or more of the values listed in the following table.
155 These values represent keyboard keys and key combinations. When using
156 these values in a command, you must type the semicolons shown in this
157 table in addition to the semicolons required by the escape sequence.
158 The codes in parentheses are not available on some keyboards.
159 ANSI.SYS will not interpret the codes in parentheses for those
160 keyboards unless you specify the /X switch in the DEVICE command for
163 String is either the ASCII code for a single character or a string
164 contained in quotation marks. For example, both 65 and "A" can be
165 used to represent an uppercase A.
167 IMPORTANT: Some of the values in the following table are not valid for all
168 computers. Check your computer's documentation for values that
171 Key Code SHIFT+code CTRL+code ALT+code
172 -------------------------------------------------------------------
174 F1 0;59 0;84 0;94 0;104
176 F2 0;60 0;85 0;95 0;105
178 F3 0;61 0;86 0;96 0;106
180 F4 0;62 0;87 0;97 0;107
182 F5 0;63 0;88 0;98 0;108
184 F6 0;64 0;89 0;99 0;109
186 F7 0;65 0;90 0;100 0;110
188 F8 0;66 0;91 0;101 0;111
190 F9 0;67 0;92 0;102 0;112
192 F10 0;68 0;93 0;103 0;113
194 F11 0;133 0;135 0;137 0;139
196 F12 0;134 0;136 0;138 0;140
198 HOME (num keypad) 0;71 55 0;119 --
200 UP ARROW (num keypad) 0;72 56 (0;141) --
202 PAGE UP (num keypad) 0;73 57 0;132 --
204 LEFT ARROW (num keypad) 0;75 52 0;115 --
206 RIGHT ARROW (num 0;77 54 0;116 --
209 END (num keypad) 0;79 49 0;117 --
211 DOWN ARROW (num keypad) 0;80 50 (0;145) --
213 PAGE DOWN (num keypad) 0;81 51 0;118 --
215 INSERT (num keypad) 0;82 48 (0;146) --
217 DELETE (num keypad) 0;83 46 (0;147) --
219 HOME (224;71) (224;71) (224;119) (224;151)
221 UP ARROW (224;72) (224;72) (224;141) (224;152)
223 PAGE UP (224;73) (224;73) (224;132) (224;153)
225 LEFT ARROW (224;75) (224;75) (224;115) (224;155)
227 RIGHT ARROW (224;77) (224;77) (224;116) (224;157)
229 END (224;79) (224;79) (224;117) (224;159)
231 DOWN ARROW (224;80) (224;80) (224;145) (224;154)
233 PAGE DOWN (224;81) (224;81) (224;118) (224;161)
235 INSERT (224;82) (224;82) (224;146) (224;162)
237 DELETE (224;83) (224;83) (224;147) (224;163)
239 PRINT SCREEN ÄÄ ÄÄ 0;114 ÄÄ
241 PAUSE/BREAK ÄÄ ÄÄ 0;0 ÄÄ
243 BACKSPACE 8 8 127 (0)
247 TAB 9 0;15 (0;148) (0;165)
345 ENTER (keypad) 13 ÄÄ 10 (0;166)
347 / (keypad) 47 47 (0;142) (0;74)
349 * (keypad) 42 (0;144) (0;78) ÄÄ
351 - (keypad) 45 45 (0;149) (0;164)
353 + (keypad) 43 43 (0;150) (0;55)
355 5 (keypad) (0;76) 53 (0;143) ÄÄ