From: allan AT interport DOT net (Allan Peda) Subject: For what it's worth, heres a version of clear 22 Mar 1998 05:48:16 -0800 Message-ID: <351083A4.42BE61D0.cygnus.gnu-win32@interport.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------8F1433E2C9E4734719BB8B8C" To: "gnu-win32 AT cygnus DOT com" This is a multi-part message in MIME format. --------------8F1433E2C9E4734719BB8B8C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit It gets the job done. What the heck, I'll attach an ansi escape code table as well. (Just my $0.02) --------------8F1433E2C9E4734719BB8B8C Content-Type: text/plain; charset=iso-8859-1; name="clear" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="clear" echo =1B[2J --------------8F1433E2C9E4734719BB8B8C Content-Type: text/html; charset=us-ascii; name="escape_sequences.html" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="escape_sequences.html" Content-Base: "file:///D|/usr/allan/work_area/html_do cs/cygwin32/escape_sequences.html" (5.12) ANSI Escape Sequences

OS/2 Warp FAQ List (20 Feb 95)


Table of Contents

(5.12) ANSI Escape Sequences


What ANSI escape sequences can be used? 

ANSI escape sequences provide cursor and screen control in OS/2 Warp 

character mode sessions.  By default ANSI support is turned ON (although 

it may be turned off with the command ANSI OFF).  ANSI support is also 

available in DOS sessions if the device driver ANSI.SYS is loaded.  See 

the online Command Reference for details. 

The following ANSI escape sequences are available: 

 Key       

 ESC       Refers to ASCII code 27 (i.e. the Escape key) 

 #         Replace with the appropriate number 

 ....      Replace with additional attributes, if desired 

 

 Escape Code Sequence          Function 

 Cursor Controls               

 ESC[#;#H or ESC[#;#f          Moves cursor to line #, column # 

 ESC[#A                        Moves cursor up # lines 

 ESC[#B                        Moves cursor down # lines 

 ESC[#C                        Moves cursor forward # spaces 

 ESC[#D                        Moves cursor back # spaces 

 ESC[#;#R                      Reports current cursor line and column 

 ESC[s                         Saves cursor position for recall later 

 ESC[u                         Return to saved cursor position 

 Erase Functions               

 ESC[2J                        Clear screen and home cursor 

 ESC[K                         Clear to end of line 

 Set Graphics Rendition        

 ESC[#;#;....;#m               Set display attributes where # is 

                               0 for normal display 

                               1 bold on 

                               4 underline (mono only) 

                               5 blink on 

                               7 reverse video on 

                               8 nondisplayed (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 

 ESC[=#;7h                     Put screen in indicated mode where # is 

                               0 for 40x25 black and white 

                               1 40x25 color 

                               2 80x25 black and white 

                               3 80x25 color 

                               4 320x200 color graphics 

                               5 320x200 black and white graphics 

                               6 640x200 black and white graphics 

                               7 to wrap at end of line 

 ESC[=#;7l                     Resets mode # set with above command 

 Keyboard Reassignments        

 ESC[#;#;....#p                The first ASCII code defines what is to be 

                               changed; the remaining codes define what it 

                               is to be changed to; strings are permitted. 

                               

                               Examples: 

                               ESC[65;81p - A becomes Q 

                               ESC[81;65p - Q becomes A 

                               ESC[0;68;"dir";13p - Assign the F10 key to 

                               a DIR command. 

                               The 0;68 portion is the extended ASCII code 

                               for the F10 key and 13 is the ASCII code 

                               for a carriage return. 

                               Other function key codes: F1=59, F2=60, 

                               F3=61, ... F10=68. 

 

 You can use ANSI escape sequences in the PROMPT environment variable to 

 create complex command line prompts.  See the online Command Reference 

 (under PROMPT) for details. 

 For example, if you have a color monitor, try editing your CONFIG.SYS 

 file so that 

 SET PROMPT=$e[32;40m$e[1m[$P]$e[0m

  

 to obtain a more colorful OS/2 Warp command line prompt.  (Case is 

 significant in the example given.)  You can do the same for your DOS 

 sessions if you edit PROMPT in AUTOEXEC.BAT, assuming you have ANSI.SYS 

 loaded.  Note that the $i portion of your PROMPT will enable the help 

 line at the top of the window or screen.  It is not included in the 

 example above. 

 

 Related information: 

 (5.10) Clever Tricks 

  

--------------8F1433E2C9E4734719BB8B8C-- - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".