One method to get color to your OS/2 Command Window (or Full Screen) is to modify the CONFIG.SYS file using:
ANSI ON
SET PROMPT ...
But that still limits you to one color, the one you pick. A lot of the power of OS/2 lies in the Properties of an object. Namely, the OS/2 Command Window and OS/2 Full Screen object. One of the preferred methods to modify an OS/2 Command Session, is to use it in conjunction with a command file (.CMD extension). When first accessing the Properties of the OS/2 Command Session, go to the "Progam" tab, if it is not there already. Look for the "Optional" section and specifically, the "Parameters" subsection.
By using "/k" in the "Parameters" subsection, one can pass command files to modify the OS/2 Command Session. First start out by creating a number of .CMD files that are in your PATH= in your CONFIG.SYS file. I put mine in C:\OS2, where CMD.EXE exists. For example, I have BLUE.CMD, CYAN.CMD, GREEN.CMD, MAGENTA.CMD, RED.CMD, and YELLOW.CMD in my C:\OS2 directory. Following are some of my command files:
GREEN.CMD (green.cmd)
@ANSI ON
@PROMPT $e[32;40m$i[$p$g]
YELLOW.CMD (yellow.cmd)
@ANSI ON
@PROMPT $e[33;40m$i[$p$g]
BLUE.CMD (blue.cmd)
@ANSI ON
@PROMPT $e[34;40m$i[$p$g]
CYAN.CMD (cyan.cmd)
@ANSI ON
@PROMPT $e[36;40m$i[$p$g]
The basic format for all these files are quite similiar. First ANSI is turned on (using the "@" character hides display of the command, but not the output of it.) Next, we start the prompt sequence. The $e begins use of ANSI escape sequences, starting with [ then we have our color combos. I always put foreground first, 31 for red, 32 for green, and so on. 40 sets the background for black. If you want a different color for the background, just add ten to the foreground; ie 32 + 10 = 42 for a green background). I'm not sure about m$i, but going to the prompt $p$g requires a [ preceding it. Finally, it is ended with ]. For colors needing a brightness intensity, These follow below:
MAGENTA.CMD (magenta.cmd)
@ANSI ON
@PROMPT $e[0;35;1m$i[$p$g]
RED.CMD (red.cmd)
@ANSI ON
@PROMPT $e[0;31;1m$i[$p$g]
After the $e[, the ANSI sequence is reset to white on black with 0. Then we add or color (35=magenta, 31=red). This is followed by a 1 for brightness. Once all of your command files are set, you can add it to you Properties using "/k" in the "Parameters" subsection. This may fill up your Command Prompts folder, so I would recommend using /k [] instead. This allows you to supply which command file to use.
When the [] are in the "Parameters" subsection, it will prompt you with a small dialog for you to enter you command file (when using /k).
This reduces the number of objects in your Command Prompts folder, unless you like have a different color for each drive. In that case, you can use the "Working Directory" subsection and add D:\, or whatever suits your fancy.
Enjoy!
This article is courtesy of www.os2ezine.com. You can view it online at http://www.os2ezine.com/20020216/page_12.html.