home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Online / CYahoo / ansi0.txt next >
Text File  |  2000-03-31  |  8KB  |  213 lines

  1.  
  2.     
  3.  
  4. ANSI/VT100 Terminal Control
  5.  
  6.    Copyright © 1996 Robert M. Free - all rights reserved]
  7.      _____________________________________________________________________________________________________________________
  8.    
  9.                 [ Status | Setup | Fonts | Cursor | Scrolling | Tabs | Erasing | Printing | Keyboard | Colors ]
  10.      _____________________________________________________________________________________________________________________
  11.    
  12.    Many computer terminals and terminal emulators support color and cursor control through a system of escape sequences. One
  13.    such standard is commonly referred to as ANSI Color. Several terminal specifications are based on the ANSI color standard,
  14.    including VT100.
  15.    
  16.    The following is a partial listing of the VT100 control set.
  17.    
  18.    <ESC> represents the ANSI "escape" character, 0x1B. Bracketed tags represent modifiable decimal parameters; eg. {ROW}
  19.    would be replaced by a row number.
  20.      _____________________________________________________________________________________________________________________
  21.    
  22. Device Status
  23.  
  24.    The following codes are used for reporting terminal/display settings, and vary depending on the implementation:
  25. Query Device Code       <ESC>[c
  26.    Requests a Report Device Code response from the device.
  27.        
  28. Report Device Code      <ESC>[{code}0c
  29.    Generated by the device in response to Query Device Code request.
  30.        
  31. Query Device Status     <ESC>[5n
  32.    Requests a Report Device Status response from the device.
  33.        
  34. Report Device OK        <ESC>[0n
  35.    Generated by the device in response to a Query Device Status request; indicates that device is functioning correctly.
  36.        
  37. Report Device Failure   <ESC>[3n
  38.    Generated by the device in response to a Query Device Status request; indicates that device is functioning improperly.
  39.        
  40. Query Cursor Position   <ESC>[6n
  41.    Requests a Report Cursor Position response from the device.
  42.        
  43. Report Cursor Position  <ESC>[{ROW};{COLUMN}R
  44.    Generated by the device in response to a Query Cursor Position request; reports current cursor position.
  45.      _____________________________________________________________________________________________________________________
  46.    
  47. Terminal Setup
  48.  
  49.    The h and l codes are used for setting terminal/display mode, and vary depending on the implementation. Line Wrap is one
  50.    of the few setup codes that tend to be used consistently:
  51.    
  52. Reset Device            <ESC>c
  53.    Reset all terminal settings to default.
  54.        
  55. Enable Line Wrap        <ESC>[7h
  56.    Text wraps to next line if longer than the length of the display area.
  57.        
  58. Disable Line Wrap       <ESC>[7l
  59.    Disables line wrapping.
  60.      _____________________________________________________________________________________________________________________
  61.    
  62. Fonts
  63.  
  64.    Some terminals support multiple fonts: normal/bold, swiss/italic, etc. There are a variety of special codes for certain
  65.    terminals; the following are fairly standard:
  66.    
  67. Font Set G0             <ESC>(
  68.    Set default font.
  69.        
  70. Font Set G1             <ESC>)
  71.    Set alternate font.
  72.      _____________________________________________________________________________________________________________________
  73.    
  74. Cursor Control
  75.  
  76. Cursor Home             <ESC>[{ROW};{COLUMN}H
  77.    Sets the cursor position where subsequent text will begin. If no row/column parameters are provided (ie. <ESC>[H), the
  78.        cursor will move to the home position, at the upper left of the screen.
  79.        
  80. Cursor Up               <ESC>[{COUNT}A
  81.    Moves the cursor up by COUNT rows; the default count is 1.
  82.        
  83. Cursor Down             <ESC>[{COUNT}B
  84.    Moves the cursor down by COUNT rows; the default count is 1.
  85.        
  86. Cursor Forward          <ESC>[{COUNT}C
  87.    Moves the cursor forward by COUNT columns; the default count is 1.
  88.        
  89. Force Cursor Position   <ESC>[{ROW};{COLUMN}f
  90.    Identical to Cursor Home.
  91.        
  92. Save Cursor             <ESC>[s
  93.    Save current cursor position.
  94.        
  95. Unsave Cursor           <ESC>[u
  96.    Restores cursor position after a Save Cursor.
  97.        
  98. Save Cursor & Attrs     <ESC>7
  99.    Save current cursor position.
  100.        
  101. Restore Cursor & Attrs  <ESC>8
  102.    Restores cursor position after a Save Cursor.
  103.      _____________________________________________________________________________________________________________________
  104.    
  105. Scrolling
  106.  
  107. Scroll Screen           <ESC>[r
  108.    Enable scrolling for entire display.
  109.        
  110. Scroll Screen           <ESC>[{start};{end}r
  111.    Enable scrolling from row {start} to row {end}.
  112.        
  113. Scroll Down             <ESC>D
  114.    Scroll display down one line.
  115.        
  116. Scroll Up               <ESC>M
  117.    Scroll display up one line.
  118.      _____________________________________________________________________________________________________________________
  119.    
  120. Tab Control
  121.  
  122. Set Tab                 <ESC>H
  123.    Sets a tab at the current position.
  124.        
  125. Clear Tab               <ESC>[g
  126.    Clears tab at the current position.
  127.        
  128. Clear All Tabs          <ESC>[3g
  129.    Clears all tabs.
  130.      _____________________________________________________________________________________________________________________
  131.    
  132. Erasing Text
  133.  
  134. Erase End of Line       <ESC>[K
  135.    Erases from the current cursor position to the end of the current line.
  136.        
  137. Erase Start of Line     <ESC>[1K
  138.    Erases from the current cursor position to the start of the current line.
  139.        
  140. Erase Line              <ESC>[2K
  141.    Erases the entire current line.
  142.        
  143. Erase Down              <ESC>[J
  144.    Erases the screen from the current line down to the bottom of the screen.
  145.        
  146. Erase Up                <ESC>[1J
  147.    Erases the screen from the current line up to the top of the screen.
  148.        
  149. Erase Screen            <ESC>[2J
  150.    Erases the screen with the background color and moves the cursor to home.
  151.      _____________________________________________________________________________________________________________________
  152.    
  153. Printing
  154.  
  155.    Some terminals support local printing:
  156. Print Screen            <ESC>[i
  157.    Print the current screen.
  158.        
  159. Print Line              <ESC>[1i
  160.    Print the current line.
  161.        
  162. Stop Print Log          <ESC>[4i
  163.    Disable log.
  164.        
  165. Start Print Log         <ESC>[5i
  166.    Start log; all received text is echoed to a printer.
  167.      _____________________________________________________________________________________________________________________
  168.    
  169. Define Key
  170.  
  171. Set Key Definition      <ESC>[{key};"{string}"p
  172.    Associates a string of text to a keyboard key. {key} indicates the key by its ASCII value in decimal.
  173.      _____________________________________________________________________________________________________________________
  174.    
  175. Set Display Attributes
  176.  
  177. Set Attribute Mode      <ESC>[{attr1};...;{attrn}m
  178.    Sets multiple display attribute settings. The following lists standard attributes:
  179. 0       Reset all attributes
  180. 1       Bright
  181. 2       Dim
  182. 4       Underscore
  183. 5       Blink
  184. 7       Reverse
  185. 8       Hidden
  186.  
  187.         Foreground Colors
  188. 30      Black
  189. 31      Red
  190. 32      Green
  191. 33      Yellow
  192. 34      Blue
  193. 35      Magenta
  194. 36      Cyan
  195. 37      White
  196.  
  197.         Background Colors
  198. 40      Black
  199. 41      Red
  200. 42      Green
  201. 43      Yellow
  202. 44      Blue
  203. 45      Magenta
  204. 46      Cyan
  205. 47      White
  206.      _____________________________________________________________________________________________________________________
  207.    
  208.              [ Top | Status | Setup | Fonts | Cursor | Scrolling | Tabs | Erasing | Printing | Keyboard | Colors ]
  209.      _____________________________________________________________________________________________________________________
  210.    
  211.    
  212.     For comments/correction/additions regarding this reference, email specs@graphcomp.com.
  213.