author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 22 Feb 2016 12:46:36 +0200 | |
changeset 1905 | fba288d59662 |
parent 1334 | 9bf0d5a1f0cf |
child 1912 | 8b81a8f0f692 |
permissions | -rw-r--r-- |
1334
9bf0d5a1f0cf
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
1 |
.. -*- coding: utf-8; -*- |
9bf0d5a1f0cf
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
2 |
.. include:: HEADER.rst |
953 | 3 |
|
4 |
========================================================== |
|
5 |
This document describes how to control a VT100 terminal. |
|
6 |
========================================================== |
|
7 |
.. contents:: |
|
1905
fba288d59662
Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
8 |
:local: |
953 | 9 |
|
10 |
ANSI escape sequence is a sequence of ASCII characters, the first two of which |
|
11 |
are the ASCII "Escape" character 27 (1Bh) and the left-bracket character " [ " |
|
12 |
(5Bh). The character or characters following the escape and left-bracket |
|
13 |
characters specify an alphanumeric code that controls a keyboard or display |
|
14 |
function. |
|
15 |
||
16 |
+----------------+---------------------------------------+-------------+ |
|
17 |
|Esc[2;1yEsc[20h |Confidence power up testSet new line |DECTSTLMN | |
|
18 |
| |mode | | |
|
19 |
+----------------+---------------------------------------+-------------+ |
|
20 |
|Esc[2;2yEsc[?1h |Confidence loopback testSet cursor key |DECTSTDECCKM | |
|
21 |
| |to application | | |
|
22 |
+----------------+---------------------------------------+-------------+ |
|
23 |
|Esc[2;9ynone |Repeat power up testSet ANSI (versus |DECTSTDECANM | |
|
24 |
| |VT52) | | |
|
25 |
+----------------+---------------------------------------+-------------+ |
|
26 |
|Esc[2;10yEsc[?3h|Repeat loopback testSet number of |DECTSTDECCOLM| |
|
27 |
| |columns to 132 | | |
|
28 |
+----------------+---------------------------------------+-------------+ |
|
29 |
|Esc[0qEsc[?4h |Turn off all four ledsSet smooth |DECLL0DECSCLM| |
|
30 |
| |scrolling | | |
|
31 |
+----------------+---------------------------------------+-------------+ |
|
32 |
|Esc[1qEsc[?5h |Turn on LED #1Set reverse video on |DECLL1DECSCNM| |
|
33 |
| |screen | | |
|
34 |
+----------------+---------------------------------------+-------------+ |
|
35 |
|Esc[2qEsc[?6h |Turn on LED #2Set origin to relative |DECLL2DECOM | |
|
36 |
+----------------+---------------------------------------+-------------+ |
|
37 |
|Esc[3qEsc[?7h |Turn on LED #3Set auto-wrap mode |DECLL3DECAWM | |
|
38 |
+----------------+---------------------------------------+-------------+ |
|
39 |
|Esc[4qEsc[?8h |Turn on LED #4Set auto-repeat mode |DECLL4DECARM | |
|
40 |
+----------------+---------------------------------------+-------------+ |
|
41 |
|Esc[?9h |Set interlacing mode |DECINLM | |
|
42 |
+----------------+---------------------------------------+-------------+ |
|
43 |
|Esc[20l |Set line feed mode |LMN | |
|
44 |
+----------------+---------------------------------------+-------------+ |
|
45 |
|Esc[?1l |Set cursor key to cursor |DECCKM | |
|
46 |
+----------------+---------------------------------------+-------------+ |
|
47 |
|Esc[?2l |Set VT52 (versus ANSI) |DECANM | |
|
48 |
+----------------+---------------------------------------+-------------+ |
|
49 |
|Esc[?3l |Set number of columns to 80 |DECCOLM | |
|
50 |
+----------------+---------------------------------------+-------------+ |
|
51 |
|Esc[?4l |Set jump scrolling |DECSCLM | |
|
52 |
+----------------+---------------------------------------+-------------+ |
|
53 |
|Esc[?5l |Set normal video on screen |DECSCNM | |
|
54 |
+----------------+---------------------------------------+-------------+ |
|
55 |
|Esc[?6l |Set origin to absolute |DECOM | |
|
56 |
+----------------+---------------------------------------+-------------+ |
|
57 |
|Esc[?7l |Reset auto-wrap mode |DECAWM | |
|
58 |
+----------------+---------------------------------------+-------------+ |
|
59 |
|Esc[?8l |Reset auto-repeat mode |DECARM | |
|
60 |
+----------------+---------------------------------------+-------------+ |
|
61 |
|Esc[?9l |Reset interlacing mode |DECINLM | |
|
62 |
+----------------+---------------------------------------+-------------+ |
|
63 |
|Esc= |Set alternate keypad mode |DECKPAM | |
|
64 |
+----------------+---------------------------------------+-------------+ |
|
65 |
|Esc> |Set numeric keypad mode |DECKPNM | |
|
66 |
+----------------+---------------------------------------+-------------+ |
|
67 |
|Esc(A |Set United Kingdom G0 character set |setukg0 | |
|
68 |
+----------------+---------------------------------------+-------------+ |
|
69 |
|Esc)A |Set United Kingdom G1 character set |setukg1 | |
|
70 |
+----------------+---------------------------------------+-------------+ |
|
71 |
|Esc(B |Set United States G0 character set |setusg0 | |
|
72 |
+----------------+---------------------------------------+-------------+ |
|
73 |
|Esc)B |Set United States G1 character set |setusg1 | |
|
74 |
+----------------+---------------------------------------+-------------+ |
|
75 |
|Esc(0 |Set G0 special chars. & line set |setspecg0 | |
|
76 |
+----------------+---------------------------------------+-------------+ |
|
77 |
|Esc)0 |Set G1 special chars. & line set |setspecg1 | |
|
78 |
+----------------+---------------------------------------+-------------+ |
|
79 |
|Esc(1 |Set G0 alternate character ROM |setaltg0 | |
|
80 |
+----------------+---------------------------------------+-------------+ |
|
81 |
|Esc)1 |Set G1 alternate character ROM |setaltg1 | |
|
82 |
+----------------+---------------------------------------+-------------+ |
|
83 |
|Esc(2 |Set G0 alt char ROM and spec. graphics |setaltspecg0 | |
|
84 |
+----------------+---------------------------------------+-------------+ |
|
85 |
|Esc)2 |Set G1 alt char ROM and spec. graphics |setaltspecg1 | |
|
86 |
+----------------+---------------------------------------+-------------+ |
|
87 |
|EscN |Set single shift 2 |SS2 | |
|
88 |
+----------------+---------------------------------------+-------------+ |
|
89 |
|EscO |Set single shift 3 |SS3 | |
|
90 |
+----------------+---------------------------------------+-------------+ |
|
91 |
|Esc[m |Turn off character attributes |SGR0 | |
|
92 |
+----------------+---------------------------------------+-------------+ |
|
93 |
|Esc[0m |Turn off character attributes |SGR0 | |
|
94 |
+----------------+---------------------------------------+-------------+ |
|
95 |
|Esc[1m |Turn bold mode on |SGR1 | |
|
96 |
+----------------+---------------------------------------+-------------+ |
|
97 |
|Esc[2m |Turn low intensity mode on |SGR2 | |
|
98 |
+----------------+---------------------------------------+-------------+ |
|
99 |
|Esc[4m |Turn underline mode on |SGR4 | |
|
100 |
+----------------+---------------------------------------+-------------+ |
|
101 |
|Esc[5m |Turn blinking mode on |SGR5 | |
|
102 |
+----------------+---------------------------------------+-------------+ |
|
103 |
|Esc[7m |Turn reverse video on |SGR7 | |
|
104 |
+----------------+---------------------------------------+-------------+ |
|
105 |
|Esc[8m |Turn invisible text mode on |SGR8 | |
|
106 |
+----------------+---------------------------------------+-------------+ |
|
107 |
|Esc[Line;Liner |Set top and bottom lines of a window |DECSTBM | |
|
108 |
+----------------+---------------------------------------+-------------+ |
|
109 |
|Esc[ValueA |Move cursor up n lines |CUU | |
|
110 |
+----------------+---------------------------------------+-------------+ |
|
111 |
|Esc[ValueB |Move cursor down n lines |CUD | |
|
112 |
+----------------+---------------------------------------+-------------+ |
|
113 |
|Esc[ValueC |Move cursor right n lines |CUF | |
|
114 |
+----------------+---------------------------------------+-------------+ |
|
115 |
|Esc[ValueD |Move cursor left n lines |CUB | |
|
116 |
+----------------+---------------------------------------+-------------+ |
|
117 |
|Esc[H |Move cursor to upper left corner |cursorhome | |
|
118 |
+----------------+---------------------------------------+-------------+ |
|
119 |
|Esc[;H |Move cursor to upper left corner |cursorhome | |
|
120 |
+----------------+---------------------------------------+-------------+ |
|
121 |
|Esc[Line;ColumnH|Move cursor to screen location v,h |CUP | |
|
122 |
+----------------+---------------------------------------+-------------+ |
|
123 |
|Esc[f |Move cursor to upper left corner |hvhome | |
|
124 |
+----------------+---------------------------------------+-------------+ |
|
125 |
|Esc[;f |Move cursor to upper left corner |hvhome | |
|
126 |
+----------------+---------------------------------------+-------------+ |
|
127 |
|Esc[Line;Columnf|Move cursor to screen location v,h |CUP | |
|
128 |
+----------------+---------------------------------------+-------------+ |
|
129 |
|EscD |Move/scroll window up one line |IND | |
|
130 |
+----------------+---------------------------------------+-------------+ |
|
131 |
|EscM |Move/scroll window down one line |RI | |
|
132 |
+----------------+---------------------------------------+-------------+ |
|
133 |
|EscE |Move to next line |NEL | |
|
134 |
+----------------+---------------------------------------+-------------+ |
|
135 |
|Esc7 |Save cursor position and attributes |DECSC | |
|
136 |
+----------------+---------------------------------------+-------------+ |
|
137 |
|Esc8 |Restore cursor position and attributes |DECSC | |
|
138 |
+----------------+---------------------------------------+-------------+ |
|
139 |
|EscH |Set a tab at the current column |HTS | |
|
140 |
+----------------+---------------------------------------+-------------+ |
|
141 |
|Esc[g |Clear a tab at the current column |TBC | |
|
142 |
+----------------+---------------------------------------+-------------+ |
|
143 |
|Esc[0g |Clear a tab at the current column |TBC | |
|
144 |
+----------------+---------------------------------------+-------------+ |
|
145 |
|Esc[3g |Clear all tabs |TBC | |
|
146 |
+----------------+---------------------------------------+-------------+ |
|
147 |
|Esc#3 |Double-height letters, top half |DECDHL | |
|
148 |
+----------------+---------------------------------------+-------------+ |
|
149 |
|Esc#4 |Double-height letters, bottom half |DECDHL | |
|
150 |
+----------------+---------------------------------------+-------------+ |
|
151 |
|Esc#5 |Single width, single height letters |DECSWL | |
|
152 |
+----------------+---------------------------------------+-------------+ |
|
153 |
|Esc#6 |Double width, single height letters |DECDWL | |
|
154 |
+----------------+---------------------------------------+-------------+ |
|
155 |
|Esc[K |Clear line from cursor right |EL0 | |
|
156 |
+----------------+---------------------------------------+-------------+ |
|
157 |
|Esc[0K |Clear line from cursor right |EL0 | |
|
158 |
+----------------+---------------------------------------+-------------+ |
|
159 |
|Esc[1K |Clear line from cursor left |EL1 | |
|
160 |
+----------------+---------------------------------------+-------------+ |
|
161 |
|Esc[2K |Clear entire line |EL2 | |
|
162 |
+----------------+---------------------------------------+-------------+ |
|
163 |
|Esc[J |Clear screen from cursor down |ED0 | |
|
164 |
+----------------+---------------------------------------+-------------+ |
|
165 |
|Esc[0J |Clear screen from cursor down |ED0 | |
|
166 |
+----------------+---------------------------------------+-------------+ |
|
167 |
|Esc[1J |Clear screen from cursor up |ED1 | |
|
168 |
+----------------+---------------------------------------+-------------+ |
|
169 |
|Esc[2J |Clear entire screen |ED2 | |
|
170 |
+----------------+---------------------------------------+-------------+ |
|
171 |
|Esc5n |Device status report |DSR | |
|
172 |
+----------------+---------------------------------------+-------------+ |
|
173 |
|Esc0n |Response: terminal is OK |DSR | |
|
174 |
+----------------+---------------------------------------+-------------+ |
|
175 |
|EscLine;ColumnR |Response: cursor is at v,h |CPR | |
|
176 |
+----------------+---------------------------------------+-------------+ |
|
177 |
|Esc[c |Identify what terminal type |DA | |
|
178 |
+----------------+---------------------------------------+-------------+ |
|
179 |
||
180 |
Codes for use in VT52 compatibility mode |
|
181 |
======================================== |
|
182 |
+-------------+-------------------------------------------+ |
|
183 |
|Esc< |Enter/exit ANSI mode (VT52) setansi | |
|
184 |
+-------------+-------------------------------------------+ |
|
185 |
|Esc= |Enter alternate keypad mode altkeypad | |
|
186 |
+-------------+-------------------------------------------+ |
|
187 |
|Esc> |Exit alternate keypad mode numkeypad | |
|
188 |
+-------------+-------------------------------------------+ |
|
189 |
|EscF |Use special graphics character set setgr | |
|
190 |
+-------------+-------------------------------------------+ |
|
191 |
|EscG |Use normal US/UK character set resetgr | |
|
192 |
+-------------+-------------------------------------------+ |
|
193 |
|EscA |Move cursor up one line cursorup | |
|
194 |
+-------------+-------------------------------------------+ |
|
195 |
|EscB |Move cursor down one line cursordn | |
|
196 |
+-------------+-------------------------------------------+ |
|
197 |
|EscC |Move cursor right one char cursorrt | |
|
198 |
+-------------+-------------------------------------------+ |
|
199 |
|EscD |Move cursor left one char cursorlf | |
|
200 |
+-------------+-------------------------------------------+ |
|
201 |
|EscH |Move cursor to upper left corner cursorhome| |
|
202 |
+-------------+-------------------------------------------+ |
|
203 |
|EscLineColumn|Move cursor to v,h location cursorpos(v,h) | |
|
204 |
+-------------+-------------------------------------------+ |
|
205 |
|EscI |Generate a reverse line-feed revindex | |
|
206 |
+-------------+-------------------------------------------+ |
|
207 |
|EscK |Erase to end of current line cleareol | |
|
208 |
+-------------+-------------------------------------------+ |
|
209 |
|EscJ |Erase to end of screen cleareos | |
|
210 |
+-------------+-------------------------------------------+ |
|
211 |
|EscZ |Identify what the terminal is ident | |
|
212 |
+-------------+-------------------------------------------+ |
|
213 |
|Esc/Z |Correct response to ident identresp | |
|
214 |
+-------------+-------------------------------------------+ |
|
215 |
||
216 |
VT100 Special Key Codes |
|
217 |
======================= |
|
218 |
||
219 |
These are sent from the terminal back to the computer when the particular key is pressed. Note that the numeric keypad keys send different codes in numeric mode than in alternate mode. See escape codes above to change keypad mode. |
|
220 |
||
221 |
Function Keys: |
|
222 |
============== |
|
223 |
||
224 |
+-----+---+ |
|
225 |
|EscOP|PF1| |
|
226 |
+-----+---+ |
|
227 |
|EscOQ|PF2| |
|
228 |
+-----+---+ |
|
229 |
|EscOR|PF3| |
|
230 |
+-----+---+ |
|
231 |
|EscOS|PF4| |
|
232 |
+-----+---+ |
|
233 |
||
234 |
Arrow Keys: |
|
235 |
=========== |
|
236 |
||
237 |
||
238 |
+-----+-----+-----+ |
|
239 |
| |Reset|Set | |
|
240 |
+-----+-----+-----+ |
|
241 |
|up |EscA |EscOA| |
|
242 |
+-----+-----+-----+ |
|
243 |
|down |EscB |EscOB| |
|
244 |
+-----+-----+-----+ |
|
245 |
|right|EscC |EscOC| |
|
246 |
+-----+-----+-----+ |
|
247 |
|left |EscD |EscOD| |
|
248 |
+-----+-----+-----+ |
|
249 |
||
250 |
Numeric Keypad Keys: |
|
251 |
==================== |
|
252 |
||
253 |
+-----+---------+ |
|
254 |
|EscOp|0 | |
|
255 |
+-----+---------+ |
|
256 |
|EscOq|1 | |
|
257 |
+-----+---------+ |
|
258 |
|EscOr|2 | |
|
259 |
+-----+---------+ |
|
260 |
|EscOs|3 | |
|
261 |
+-----+---------+ |
|
262 |
|EscOt|4 | |
|
263 |
+-----+---------+ |
|
264 |
|EscOu|5 | |
|
265 |
+-----+---------+ |
|
266 |
|EscOv|6 | |
|
267 |
+-----+---------+ |
|
268 |
|EscOw|7 | |
|
269 |
+-----+---------+ |
|
270 |
|EscOx|8 | |
|
271 |
+-----+---------+ |
|
272 |
|EscOy|9 | |
|
273 |
+-----+---------+ |
|
274 |
|EscOm|-(minus) | |
|
275 |
+-----+---------+ |
|
276 |
|EscOl|,(comma) | |
|
277 |
+-----+---------+ |
|
278 |
|EscOn|.(period)| |
|
279 |
+-----+---------+ |
|
280 |
|EscOM|^M | |
|
281 |
+-----+---------+ |
|
282 |
||
283 |
Printing: |
|
284 |
========= |
|
285 |
||
286 |
+------+------------+--------------------------------------------+ |
|
287 |
|Esc[i |Print Screen|Print the current screen | |
|
288 |
+------+------------+--------------------------------------------+ |
|
289 |
|Esc[1i|Print Line |Print the current line | |
|
290 |
+------+------------+--------------------------------------------+ |
|
291 |
|Esc[4i|Stop Print |Disable log | |
|
292 |
+------+------------+--------------------------------------------+ |
|
293 |
|Esc[5i|Start Print |Start log; all received text is echoed to a | |
|
294 |
| | | printer | |
|
295 |
+------+------------+--------------------------------------------+ |
|
296 |