ANSI Color with Xterm and SecureCRT

Ed Greshko Ed.Greshko at greshko.com
Thu Aug 12 04:02:22 UTC 2004


On Thu, 2004-08-12 at 03:40, Mike Vanecek wrote:

> Yes and no. It does indeed change the default display at the command line to 
> be black on white. However an application that sends a display code to 
> display white now displays black and one that sends a display code to display 
> black now displays white. Changing the color definition of white to black and 
> vice versa just mucks up the other applications since they expect black to be 
> black, not white. 
> 
> Hence, what I need to know is how to send the codes from the xterm terminal 
> session to tell the display to use white as bg and black as fg as the default 
> system display scheme. 
> 
> I have exchanged several emails with the SecureCRT folks as well. They have 
> not been able to suggest anything that works.

I think that is because it doesn't have everything to do with SecureCRT
but also in conjunction with the O/S side.

In order to do what you want I believe you will have to learn more about
"terminfo" and "tput" and other things for which I only have a passing
familiarity.

I believe you can try taking a stock vt100 terminfo and modify it for
your own use.

Even then, it may not work perfectly with SecureCRT or any other
terminal emulation software.  I say this since I believe that the ANSI
color standard background color is defined as "black" and that in the
absence of any specific ANSI control characters being sent the emulation
SW will revert to the defaults specified in its configuration.

I think you can see this for yourself if you enter the command:

tput rev

Followed by any command, except for ls since ls uses the environment
variable LS_COLORS and then will reset the terminal to the state defined
in the terminfo database.

After "tput rev" typed you will get reverse video but only where the
system output.....

(If I had more time I would even explore using tcpdump to see what
exactly is being sent to the terminal....)

To reach Nirvana you may have to find terminal emulation sw that allows
you to compile your own terminfo settings and then create a matching set
on the OS side.....

In the case of ANSI colors...I think it is a case of..."You can please
some of the people all of the time....."

Good luck....

Ed

-- 
"I think the problem, to be quite honest with you, is that you've never
actually known what the question is."

--The computer "Deep Thought" in "Hitchhiker's Guide to The Galaxy"





More information about the redhat-list mailing list