Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / konsole / developer-doc / old-documents / More / ansi.sys.txt
blob5600175f35ca186eb5ff77f117e3f8e12596d97d
1 <TITLE>ANSI.SYS -- ansi terminal emulation escape sequences</TITLE>
2  
3                                   ANSI.SYS
4  
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.
40 ESC[PL;PcH
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.
47 ESC[PL;Pcf
48     Cursor Position: Works the same way as the preceding Cursor Position
49     escape sequence.
51 ESC[PnA
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.
56 ESC[PnB
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.
61 ESC[PnC
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.
66 ESC[PnD
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.
71 ESC[s
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
74     Position sequence.
76 ESC[u
77     Restore Cursor Position: Returns the cursor to the position stored
78     by the Save Cursor Position sequence.
80 ESC[2J
81     Erase Display: Clears the screen and moves the cursor to the home
82     position (line 0, column 0).
84 ESC[K
85     Erase Line: Clears all characters from the cursor position to the
86     end of the line (including the character at the cursor position).
88 ESC[Ps;...;Psm
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
93     screen.
95     Text attributes
96        0    All attributes off
97        1    Bold on
98        4    Underscore (on monochrome display adapter only)
99        5    Blink on
100        7    Reverse video on
101        8    Concealed on
103     Foreground colors
104        30    Black
105        31    Red
106        32    Green
107        33    Yellow
108        34    Blue
109        35    Magenta
110        36    Cyan
111        37    White
113     Background colors
114        40    Black
115        41    Red
116        42    Green
117        43    Yellow
118        44    Blue
119        45    Magenta
120        46    Cyan
121        47    White
123     Parameters 30 through 47 meet the ISO 6429 standard.
125 ESC[=psh
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)
145 ESC[=Psl
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.
150 ESC[code;string;...p
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
161       ANSI.SYS.
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
169             are different.
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      --
207 keypad)
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)
245 ENTER                     13        ÄÄ          10         (0
247 TAB                       9         0;15        (0;148)    (0;165)
249 NULL                      0;3       ÄÄ          ÄÄ         ÄÄ
251 A                         97        65          1          0;30
253 B                         98        66          2          0;48
255 C                         99        66          3          0;46
257 D                         100       68          4          0;32
259 E                         101       69          5          0;18
261 F                         102       70          6          0;33
263 G                         103       71          7          0;34
265 H                         104       72          8          0;35
267 I                         105       73          9          0;23
269 J                         106       74          10         0;36
271 K                         107       75          11         0;37
273 L                         108       76          12         0;38
275 M                         109       77          13         0;50
277 N                         110       78          14         0;49
279 O                         111       79          15         0;24
281 P                         112       80          16         0;25
283 Q                         113       81          17         0;16
285 R                         114       82          18         0;19
287 S                         115       83          19         0;31
289 T                         116       84          20         0;20
291 U                         117       85          21         0;22
293 V                         118       86          22         0;47
295 W                         119       87          23         0;17
297 X                         120       88          24         0;45
299 Y                         121       89          25         0;21
301 Z                         122       90          26         0;44
303 1                         49        33          ÄÄ         0;120
305 2                         50        64          0          0;121
307 3                         51        35          ÄÄ         0;122
309 4                         52        36          ÄÄ         0;123
311 5                         53        37          ÄÄ         0;124
313 6                         54        94          30         0;125
315 7                         55        38          ÄÄ         0;126
317 8                         56        42          ÄÄ         0;126
319 9                         57        40          ÄÄ         0;127
321 0                         48        41          ÄÄ         0;129
323 -                         45        95          31         0;130
325 =                         61        43          ÄÄ-        0;131
327 [                         91        123         27         0;26
329 ]                         93        125         29         0;27
331                           92        124         28         0;43
333 ;                         59        58          ÄÄ         0;39
335 '                         39        34          ÄÄ         0;40
337 ,                         44        60          ÄÄ         0;51
339 .                         46        62          ÄÄ         0;52
341 /                         47        63          ÄÄ         0;53
343 `                         96        126         ÄÄ         (0;41)
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)    ÄÄ