Screen colors & terminfo trivia

Rich Braun rbraun at spdcc.COM
Wed May 29 08:16:07 AEST 1991


I'm in the midst of porting a DOS application to SCO Unix, and have
run into a design issue which might have been solved already.  The
application uses 16 colors (I think; maybe only 8) for character-
oriented displays.  It handles character colors by simply setting
values in the high byte of each element of the display memory
(which is a 80 x 25 x 2-byte array).

I want this thing to be portable across Unix platforms, and am
therefore using terminfo routine calls.  But I'd like to duplicate
the "look and feel" from DOS, at least for the console terminal of
an SCO system.  It appears to me that terminfo isn't powerful enough
to handle this without adding extra attributes, and I don't have
any example applications which try to do this (the source code to
'ecu' does some of this but doesn't try to go crazy with multiple
colors).

SCO documentation doesn't even tell you that the escape sequences
to set colors are <ESC>[=H, <ESC>[=F, etc.

On a semi-related point, I'd like to be able to set attributes in
the character map without having to fetch the characters out and
put them back.  (For highlighting menu items, etc.)  The DOS code
uses functions like "set_attr (x,y,numchars,attrbits)" to do this,
and I don't see an equivalent in terminfo.  Yet I'm pretty sure
the internals of terminfo should easily allow this.

Any suggestions or sample code?

Thanks,
-rich



More information about the Comp.unix.sysv386 mailing list