ANSI control [] codes

Enter anywhere as part of the command line as an echo command (or use in batch files). What you will be doing is echoing a direction to the screen. ANSI.SYS must be loaded as a driver (or NNANSI.SYS). ANSI.SYS will intercept this and reset the screen to your new parameters.

.. directions ..

Use "echo. ESC[CODE" to impliment

The ESC (Escape) shows up as a left arrow on DOS screens, but you may have to use Alt-27 to put it on screen. I haven't found the HTML character translation for this, so I am using "ESC" below.

..when all fails on Unix: use \033

combine as (example): ESC[BRIGHTNESS;FOREGROUND;BACKGROUNDm

.. codes ..


BRIGHTNESS
CODE MEANING
0 normal
1 Bold
4 Underscore (mono)
5 Blink
7 Reverse
8 Conceal


FOREGROUND colors
CODE MEANING
31 Red
32 Green
33 Yellow
34 Blue
35 Magenta
36 Cyan
37 White


BACKGROUND colors
CODE MEANING
41 Red
42 Green
43 Yellow
44 Blue
45 Magenta
46 Cyan
47 White


OTHER THINGS
MEANING CODE
CURSOR POSITION [line;columnH
CURSOR UP [linesA
CURSOR DOWN [columnsB
CURSOR FORWARD [spacesC
CURSOR BACK [spacesD
SAVE POSITION [s
RESTORE SAVED POSITION[u
CLEAR SCREEN[2J
CLEAR LINE [K

.. example ..

To have the prompt in bright yellow letters, set it as follows..

prompt ESC[1;33m Ginger $p$g ESC[0;37m

Since the second command resets the screen to white on black, the prompt will stand out from any other text on the screen.


[] HOST: Outflux.net, http://www.Outflux.net
URL: http://jnocook.net/user/ansi.htm

22