author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Fri, 16 Sep 2011 01:13:06 +0300 | |
changeset 993 | e3fefdeb1cbf |
parent 987 | deddbee5fe5f |
child 1032 | 4decc3e00bb6 |
permissions | -rw-r--r-- |
929 | 1 |
.. -*- coding: utf-8; -*- |
926
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
Spec. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
===== |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
http://en.wikipedia.org/wiki/C0_and_C1_control_codes |
929 | 7 |
C0 and C1 control codes |
926
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
http://en.wikipedia.org/wiki/ECMA-48 |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
ANSI escape sequences |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
|
985
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
11 |
Check terminal capabilities. |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
12 |
============================ |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
13 |
:: |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
14 |
|
986 | 15 |
$ infocmp -1 xterm |
985
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
16 |
... |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
17 |
colors#8, |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
18 |
bold=\E[1m, |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
19 |
blink=\E[5m, |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
20 |
... |
986 | 21 |
$ infocmp -1L xterm # print long name |
22 |
||
985
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
23 |
$ tput -Txterm colors |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
24 |
8 |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
25 |
$ tput -Txterm blink |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
26 |
^[[5m |
6a75b1b2976b
Check terminal capabilities.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
929
diff
changeset
|
27 |
|
987
deddbee5fe5f
Print highlighted word.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
986
diff
changeset
|
28 |
Print highlighted word:: |
deddbee5fe5f
Print highlighted word.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
986
diff
changeset
|
29 |
|
deddbee5fe5f
Print highlighted word.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
986
diff
changeset
|
30 |
$ h=`tput smso` |
deddbee5fe5f
Print highlighted word.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
986
diff
changeset
|
31 |
$ n=`tput rmso` |
deddbee5fe5f
Print highlighted word.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
986
diff
changeset
|
32 |
$ echo ${h}xxx${n} |
deddbee5fe5f
Print highlighted word.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
986
diff
changeset
|
33 |
xxx |
deddbee5fe5f
Print highlighted word.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
986
diff
changeset
|
34 |
|
926
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
35 |
Old hardware terminal. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
36 |
====================== |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
37 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
38 |
VT102. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
39 |
------ |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
40 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
41 |
VT100 is a video terminal that was made by Digital Equipment Corporation (DEC). It was introduced in |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
42 |
August 1978. Its detailed attributes became the de facto standard for terminal emulators. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
43 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
44 |
The control sequences used by the VT100 family are based on the ANSI X3.64 standard, later ECMA-48 |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
45 |
and ISO/IEC 6429. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
46 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
47 |
The VT101 and VT102 were cost-reduced non-expandable follow-on products, with the VT102 including |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
48 |
the AVO and serial printer port options of the VT100. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
49 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
50 |
In 1983, the VT100 was replaced by the more-powerful VT200 series terminals such as the VT220. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
51 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
52 |
http://en.wikipedia.org/wiki/VT102 |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
53 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
54 |
VT220. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
55 |
------ |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
56 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
57 |
http://en.wikipedia.org/wiki/VT220 |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
58 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
59 |
X window pseudo terminal. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
60 |
========================= |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
61 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
62 |
luit. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
63 |
----- |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
64 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
65 |
Luit is a filter that can be run between an arbitrary application and a UTF-8 |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
66 |
terminal emulator. It will convert application output from the locale's |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
67 |
encoding into UTF-8, and convert terminal input from UTF-8 into the locale's |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
68 |
encoding. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
69 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
70 |
Example:: |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
71 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
72 |
$ luit -encoding 'ISO 8859-1' emacs -nw |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
73 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
74 |
Capture terminal session. |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
75 |
========================= |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
76 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
77 |
Use *script* utility:: |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
78 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
79 |
$ script out.file |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
80 |
sh# .... |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
81 |
^d |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
82 |
$ cat out.file |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
83 |
... |
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
84 |
|
25c9a1591ba1
Capture terminal session.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
85 |