[comp.unix.i386] color for 386/ix

larry@nstar.UUCP (Larry Snyder) (03/05/90)

As most of you know, I am running 386/ix.  I have a friend who 
is interested in running 386/ix on his machine - but he really
wants color consoles.

Under SCO Xenix - the setcolor utility works rather well - and
keeps the console in the set up colors when using most of the system
utilities.

I received a "setcolor" utility for 386 unix and it works until 
I bring up vi - in which case the console is reset to white on 
black.  If I run this utility again, the set up color remains
active again until I run one of several system utilities or 
applications in which case the console is reset.  Is there
any way to set and keep the console in a specific color combination?

-- 
The Northern Star Public Access Unix Site, Notre Dame, Indiana USA 
     uucp: iuvax!ndmath!nstar!larry    internet: larry@nstar
USR HST 219-287-9020 * PEP 219-289-3745	* Hayes V9600 219-289-0286

jay@metran.UUCP (Jay Ts) (03/05/90)

[1;37;45m 
In article <511241@nstar.UUCP>, larry@nstar.UUCP (Larry Snyder) writes:
> [...]
> As most of you know, I am running 386/ix. [...]
> I received a "setcolor" utility for 386 unix and it works until 
> I bring up vi - in which case the console is reset to white on 
> black.  If I run this utility again, the set up color remains
  ^^^^^
[1;37;44m 
Actually, *grey* on black.  Normally, you get white by hiliting grey.
[1;37;45m 
> active again until I run one of several system utilities or 
> applications in which case the console is reset.  Is there
> any way to set and keep the console in a specific color combination?
[1;37;44m 
What I am now doing to try to achieve this is a horrible kludge, but since I
haven't seen anyone post a better method, here it is.

What I do is simply run a setcolor-like command from my crontab, which looks
like this: (look at it with vi, to show escape char's)
--------------------- start of crontab entry ---------------------
* * * * * echo -n '[1;37;44m' >/dev/console; echo -n '[1;32;44m' >/dev/vt01; echo -n '[1;37;43m' >/dev/vt02; echo -n '[1;37;45m' >/dev/vt03; echo -n '[1;33;45m' >/dev/vt04;
--------------------- end of crontab entry -----------------------
[1;37;44m 
(sorry if this messes up your screen...)  Basically, I am just printing the
necessary escape sequences -- see display(7) in the 386/ix User's/System
Administrator's Reference Manual -- to the console and virtual terminals once
each minute.  It's rather nice getting white (not grey) text, and a different
color combination for each virtual screen, so I know which one I'm using.
[1;32;44m 
Now, this method doesn't *really* work, it just comes close.  I just use it
because I'm desperate for color text.  If vi messes up the colors, it will take
up to a minute for them to be reset, and you still have to press CTRL-L to
refresh the whole screen.  vi is most annoying; it resets the colors upon
startup and each time it prints an error message!
[1;37;43m 
OK, now that I have made a fool of myself by posting this silliness, someone
*please* tell us of a better way!
[1;37;44m 
				Jay Ts
				uunet!metran!jay
[0m				[5;41;33;1mflames[0m to [1m/dev/null
[0m

cpcahil@virtech.uucp (Conor P. Cahill) (03/05/90)

In article <511241@nstar.UUCP> larry@nstar.UUCP (Larry Snyder) writes:
>I received a "setcolor" utility for 386 unix and it works until 
>I bring up vi - in which case the console is reset to white on 
>black.

This can be fixed by modifying the terminfo definition for AT386 (or whatever
you are using for your terminal type).  I believe the parameter is something
like initc for "initialize color", but I'm not positive. You should
add in the sequence to set the appropriate color for initc.  You might 
want to have several AT386-xx entries for each color path and set up your
setcolor utility as a shell function which will change your TERM environment
variable to match the color settings.  Review the terminfo(4) man page
for more information.


-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 

daveb@i88.isc.com (David G. Burton) (03/08/90)

In article <1990Mar5.125403.10941@virtech.uucp> cpcahil@virtech.UUCP (Conor P. Cahill) writes:
|In article <511241@nstar.UUCP> larry@nstar.UUCP (Larry Snyder) writes:
|:I received a "setcolor" utility for 386 unix and it works until 
|:I bring up vi - in which case the console is reset to white on 
|:black.
|
|This can be fixed by modifying the terminfo definition for AT386 (or whatever
|you are using for your terminal type).  I believe the parameter is something
|like initc for "initialize color", but I'm not positive. You should
|add in the sequence to set the appropriate color for initc.  You might 
|want to have several AT386-xx entries for each color path and set up your
|setcolor utility as a shell function which will change your TERM environment
|variable to match the color settings.  Review the terminfo(4) man page
|for more information.

I rather prefer the XENIX approach to this: setcolor(1) defines the color
"set" used by all applications (unless they specifically override). This
includes the shell, vi, more, and many applications that presume a
black-and-white environment. Advantages:

. don't need to modify the termcap/terminfo descriptions
. can be set independently by each user to individual preferences,
	without resorting to AT386_DAVEB, AT386_SANDY, etc.
. it seems to change the definitions of "white" and "reverse" to
	whatever is defined, thus it works with any application that
	tries to set the screen color to "white" or "reverse".

One disadvantage resulting from the "redefinition" is that applications
that really do want/need white can't get it, and the redefined colors
may interfere with colors used by applications to distinguish objects
(e.g. word processors to indicate bold text). Also, this requires driver
support, so that \E]0m (or whatever) doesn't give the default white.
--
Dave Burton
uunet!ism780c!laidbak!daveb