Written by Bernie Lawrence. Dallas, Tx. June 10, 1985 The following text will describe the various escape codes that allow computers to transmit color text over communication lines. Using ANSI escape codes, any computer can recieve and transmit color text as long as the communication program can interpret the escape sequences. The escape sequences can be thought of the same as ones sent to a printer to change the appearance of the output. All ANSI codes begin with the one byte character ESC (decimal 27), and are followed by the left bracket "[". Additional parameters, which follow the bracket are seperated with a semi- colon. All codes are ended with a singal alphabetic character which determines the function of the escape sequence. Since the characters come in one at a time, as soon as the ESC character is received start building the sequence until an alphabetic character is input. The case of the alphabetic character is very important since they mean different things. For example,"H" (which means set cursor position) is different than "h" ,(which means set the display width and type). Notes: 1) The default value is used when no explicit value is given, or a value of zero, is specified. 2) The default value is 1 unless otherwise specified below. 3) # - Numeric Parameter. A decimal number specified with ASCII characters. 4) In the control sequences described below, ESC is the 1 byte code for ESC (decimal 27), and not the three characters "ESC". CURSOR CONTROL Cursor Position (CUP) ESC[#;#H Moves the cursor to the position specified by the paramters. The first parameter specifies the line number and the second parameter specifies the column number. If no paramter is given, the cursor is moved to the home position (Row 1, Column 1). Example: ESC[10;20H - moves the cursor to row 10, column 20. Cursor Up (CUU) ESC[#A Moves the cursor up # lines without changing columns. The value of # determines the number of lines to move up. This sequence is ignored if the cursor is already on the top line. Example: ESC[5A - moves the cursor up 5 lines without changing columns. Cursor Down (CUD) ESC[#B Moves the cursor down # lines without changing columns. The value of # determines the number of lines to move down. This sequence is ignored if the cursor is already on the bottom line. Example: ESC[5B - moves the cursor down 5 lines without changing columns. Cursor Forward (CUF) ESC[#C Moves the cursor forward # columns without changing lines. The value of # determines the number of columns moved forward. This sequence is ignored if the cursor is already in the rightmost column. Example: ESC[25C - moves the cursor forward 25 columns. Cursor Backward (CUB) ESC[#n Moves the cursor back # columns without changing lines. The value # determines the number of columns moved backwards. This sequence is ignored if the cursor is already in the leftmost column. Example: ESC[1n - moves the cursor backwards 1 column. Horizontal and Vertical Position (HVP) ESC[#;#f This control sequence is the same as CUP. Example: ESC[10;20f - moves the cursor to row 10, column 20. Device Status Report (DSR) ESC[6n Upon receipt of this command, the console driver will output a CPR sequence as described below. Cursor Position Report (CPR) ESC[#;#R The CPR sequence reports the current cursor position through the standard input device. The first parameter specifies the current line and the second parameter specifies the current column. Save Cursor Position (SCP) ESC[s The current cursor position is saved. This cursor position can be restored with the RCP sequence. Restore Cursor Position (RCP) ESC[u Restores the cursor to the value it had when the control sequence SCP was received. Erase in Display (ED) ESC[2J Erases all of the screen and the cursor goes to the home position (row 1, column 1). Erase in Line (EL) ESC[k Erases from the cursor to the end of the line and includes the cursor position. Set Graphics Rendition (SGR) ESC[#;...;#m Set the character attribute specified by then parameter(s). All following characters will have the attribute according to the parameter(s) until the next occurence of SGR. Note: attribute means the foreground color, the background color, blink, high intensity, underscore, reverse video, and invisible. Parameter Meaning 0 All Attributes Off (white on black) 1 Bold On (high intensity) 4 Underscore On (Some monitors only) 5 Blink On 7 Reverse Video 8 Cancelled On (invisible) 30 Black Foreground 31 Red Foreground 32 Green Foreground 33 Yellow Foreground 34 Blue Foreground 35 Magenta Foreground 36 Cyan Foreground 37 White Foreground 40 Black Background 41 Red Background 42 Green Background 43 Yellow Background 44 Blue Background 45 Magenta Background 46 Cyan Background 47 White Background Example: ESC[33;40;1m - all following characters will have a Yellow foreground, a Black background, and be in high intensity until receipt of another SGR control sequence. ESC[0m - all following characters will have a white foreground, on a black background, in normal intensity. Note: Several parameters can be stacked. For example, ESC[0;1;5;7;31;44m the above example will reset the attributes, set high intensity, set blink on, set reversed video, set foreground color to red, and set background color to blue. Note that since reverse video is on the foreground will actually be blue and the background will be red. If you have further questions, please send E-mail to Fido #75 ThumbTech is Plano, Texas (214)-985-7926. Send messages to Josey Wales. further questions, please send E-mail to Fido #75 ThumbTech is Plano, Texas (214)-985-7926. Send messa