home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / terminal / 1481 < prev    next >
Encoding:
Internet Message Format  |  1992-12-26  |  5.4 KB

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