Setting Text Color to White Using ANSI.SYS

Software related questions

Setting Text Color to White Using ANSI.SYS

Postby Tempest » Fri Apr 12, 2013 6:43 am

Since DOS decides to set the text color to gray every time it starts, I want to use ANSI.SYS to set it back to, IMHO, a much more readable white color. I've found some way to do this, but unfortunately I can't figure out how to make them work. I think part of the problem may be that I have to use an Escape Key code, which I'm not sure is possible on the PCjr keyboard.

After looking at some websites it appears that I need to enter something like this in my Autoexec.bat file:

prompt $e[0m$p$g
or
prompt $p$g$e[37m


I also found a refence to a code like this:

ESC[1;37;40m


Can anyone help me figure out how to do this? I want to keep the background black and set the text to a nice bright white.
Omne ignotum pro magnifico

--- AtariProtos.com ---
The color of infinity inside an empty glass
Tempest
 
Posts: 308
Joined: Thu Jan 14, 2010 5:43 pm

Re: Setting Text Color to White Using ANSI.SYS

Postby Brutman » Fri Apr 12, 2013 6:09 pm

You were really close ...

ANSI escape sequences start with the CSI sequence, which is the escape character (ASCII 27) followed by the open bracket. After that you can give parameters and a command. In this case the command is 'm', which is set screen attributes.

Parameters 30 to 37 specify a foreground color. Parameters 40 to 47 specify a background color. 0 is "reset" and 1 is "bold/bright".

Try swapping the order of the escape sequence and the rest of the prompt. It is important to set the color first; subsequent characters will use that.
Brutman
Site Admin
 
Posts: 951
Joined: Sat Jun 21, 2008 5:03 pm

Re: Setting Text Color to White Using ANSI.SYS

Postby Tempest » Fri Apr 12, 2013 6:39 pm

How do I enter the escape character (ASCII 27)? Also, what do you mean by change the order? Can you type out exactly what you mean?
Omne ignotum pro magnifico

--- AtariProtos.com ---
The color of infinity inside an empty glass
Tempest
 
Posts: 308
Joined: Thu Jan 14, 2010 5:43 pm

Re: Setting Text Color to White Using ANSI.SYS

Postby Brutman » Sat Apr 13, 2013 6:37 am

You don't enter the Esc character directly - you did it as you did with $e.

prompt $e[1;37;40m$p$g should do the trick. I tested this on a VM with DOS 6; it will be the same on a PCjr.
Brutman
Site Admin
 
Posts: 951
Joined: Sat Jun 21, 2008 5:03 pm


Return to PCjr Software

Who is online

Users browsing this forum: No registered users and 3 guests

cron