1
Newsgroups: comp.terminals,comp.protocols.misc
2
Subject: ANSI X3.64 sequences (was Re: VT100 scrolling region)
3
Summary: Escape code effects
4
Expires: Sun, 31 Jan 1993 22:23:24 GMT
5
References: <18623@mindlink.bc.ca> <lj3vgrINNieu@news.bbn.com>
6
Sender: shuford@cs.utk.edu
7
Followup-To: comp.terminals
9
Organization: University of Tennessee, Knoxville--Dept. of Computer Science
10
Keywords: VT100, scroll, control code, Escape, ANSI X3.64, terminal
12
In article <lj3vgrINNieu@news.bbn.com> pdsmith@bbn.com (Peter D. Smith) writes:
13
> In article <18623@mindlink.bc.ca>, Frank@mindlink.bc.ca (Frank I. Reiter)
15
> > Part of an application I am working on includes a VT100 emulator.
16
> > 1) Does ESC [;22r mean "scroll lines 0 through 22" or does it mean "Set
17
> > the bottom scrolling line to 22, leave the top line as it is set already"?
19
> It should mean 'scroll lines 1 to 22'.
21
The control sequences recognized by the Digital Equipment Corporation
22
VT100, VT200, VT300, and VT400-family character-cell video terminals
23
are an extended variant of the control sequences specified by an ANSI
24
standard, ANSI X3.64. (ISO DP6429 is the international version.)
26
The generic sequence introducer is a thing called CSI (Control
27
Sequence Introducer). If you are using 8-bit communication, you
28
can use the hexadecimal value 9B to represent this (but be sure you
29
understand the side effects thereof). Otherwise, use the 7-bit
30
equivalent: the Escape character (1Bh) followed by [ (the left
33
The canonical form of the given scroll-region command would be
41
(where xx and yy are decimal digits expressed in ASCII/IA5; you do not
42
actually use a space between sequence elements, this is for clarity.
43
Be careful with the notation here--sometimes a space character _is_
44
a sequence element, as in the SR Scroll Right editing function.)
46
In an X3.64 control sequence, the numeric arguments may default to an
47
arbitrary value specific to the device function being controlled. Do
48
not assume that the default always will be 0 or 1. (Or there may be
49
no default allowed.) For example, the numeric arguments in the GSM
50
(Graphic Size Modify) sequence have the default values 100, 100.
52
As a private extension to X3.64, DEC defines the DECSTBM (Set Top and
53
Bottom Margins) command as follows:
57
Selects top and bottom margins defining the scrolling region.
58
Pt is the line number of the first line in the scrolling region.
59
Pb is the line number of the bottom line.
60
If you do not select either Pt or Pb, they default to the top
61
and bottom respectively. Lines are counted from 1.
63
(See \VT220 Programmer Pocket Guide/, part EK-VT220-HR-002, page 37.)
65
> Remember that these sequences
66
> could be implemented in TTL without a microprocessor of any
67
> kind & therefore use the simplest possible implementation.
69
Peter must be thinking of the much simpler DEC VT52 sequences. As far
70
as I know, terminals implementing X3.64 have ALWAYS used a built-in
71
microprocessor. The VT100 was built around an 8-bit-bus Intel 8085.
73
In fact, when the X3.64 document was published (circa 1978), some
74
vendors, insisting on using discrete logic designs, objected that the
75
standard was so complex it could not be implemented. Most of these
76
vendors are now floating belly-up on the tide of technology. Some
77
credit is due to The Heath Company for a pioneering microprocessor-
78
based video terminal that implemented many of the X3.64 functions.
80
> > 2) Should a clear screen code clear the scrolling region only, or the
81
> > entire screen? How about a clear to end of screen?
83
> I think this is the whole screen regardless of the scrolling region.
84
> Don't bet your company on it, though.
86
Screen clearing should not depend on scrolling.
88
Erasing parts of the display (EL and ED) in the VT100 is performed thus:
90
Erase from cursor to end of line Esc [ 0 K or Esc [ K
91
Erase from beginning of line to cursor Esc [ 1 K
92
Erase line containing cursor Esc [ 2 K
93
Erase from cursor to end of screen Esc [ 0 J or Esc [ J
94
Erase from beginning of screen to cursor Esc [ 1 J
95
Erase entire screen Esc [ 2 J
97
Some brain-damaged terminal/emulators respond to Esc [ J as if it were
98
Esc [ 2 J (here the default is 0), and _some_ versions of Microsoft's
99
MS-DOS ANSI.SYS contain a bug requiring software to send Esc [ k
100
(instead of the uppercase). Of course, you would never make this mistake.
102
The VT200 and later terminals have the ECH control sequence:
106
(where yy is a numeric parameter)
108
This erases the cursor position and the next (yy-1) positions, but this
109
is not part of the least common denominator VT100.
113
There is still various video-terminal information available for
114
anonymous FTP in "pub/shuford" from
116
CS.UTK.EDU [128.169.94.1]
120
VT, Flip Chip, DIBOL, and Rainbow are trademarks of Digital Equipment
123
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =