On Sun, Oct 25, 2009 at 01:51:33AM +0100, Nicholas Marriott wrote:
> On Sat, Oct 24, 2009 at 07:42:26PM -0400, Thomas Dickey wrote:
> > well... if you're using terminfo to tell the number of colors (256 for
> > example), it's a reasonably safe assumption that xterm supports both
> > the aixterm (16-color) and 256-color controls.  Unless of course the
> > $TERM is set incorrectly, in which case the 256-colors is suspect.
> > 
> > For other terminals, the 16-color feature was used - which accounts for
> > the 16color variants.
> 
> Yes, I can make that assumption but I'd have to bypass terminfo and output the
> 9x and 10x codes directly and I'm reluctant to add another case where I do
> that. I suppose it wouldn't do any harm, maybe I'll give it a go.

I'd do that (there aren't a lot of different failure modes here).
  
> > > With latest terminfo I could say that any terminal with colors=256 has a
> > > setaf/setab that correctly accepts all 256 colours, then use setaf/setab
> > > instead of sending \\033[38;5;c directly to get the benefit of any
> > > optimisations in terminfo, but that isn't a safe assumption with an older
> > > terminfo.src :-/.
> > 
> > I'm not sure why - from what I'm reading the only problem was that tmux
> > didn't recognize the aixterm codes.
> 
> Yes, that problem is fixed, but I was thinking it would be nice to get the
> optimisation automatically using setaf/setab. Unfortunately, until very
> recently OpenBSD did this:
> 
> $ TERM=xterm-256color tput setaf 10|cat -v; echo
> ^[[310m

I did see that, didn't need to followup (since it was found in the context
of the bug-fix).  When we added 256-/88-colors, it wasn't apparent that SGR
parsing would be a problem...
 
> I thought it was fixed by using a newer terminfo.src (sorry) but checking 
> again
> it is actually fixed by a separate OpenBSD bug fix just a few weeks ago. 
> Anyway
> because of this tmux bypasses terminfo and just sends \\033[38;5;c directly 
> and
> I am stuck with that at least until my fix gets into a couple of releases (or 
> I
> #ifdef __OpenBSD__ it in tmux).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Attachment: pgpMeMRugHdbr.pgp
Description: PGP signature

Reply via email to