On Sat, Oct 24, 2009 at 07:42:26PM -0400, Thomas Dickey wrote: > On Sat, Oct 24, 2009 at 10:11:30PM +0100, Nicholas Marriott wrote: > > On Sat, Oct 24, 2009 at 03:54:57PM -0400, Thomas Dickey wrote: > > > Since aixterm 16-colors are part of the default configuration settings, > > > it's reasonable to count on the controls being present. > > > > I can't count on them being present because tmux may be detached from a > > terminal which supports them and reattached to a terminal which does not, so > > unless I can establish for sure from terminfo that they are I have to assume > > they are not supported and convert them to bold+setaf/setab 0-7. > > 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. > > 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 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). On that note (I was actually going to mail you separately about this), there is a minor comment fix in OpenBSD that it would be nice if you could apply to your terminfo.src to make one fewer local change, a diff below. Thanks --- terminfo.src.orig Sun Oct 25 01:11:52 2009 +++ terminfo.src Sun Oct 25 01:13:22 2009 @@ -19562,7 +19562,7 @@ # # CTRM terminal emulator -# 1. underlining is not allowed with colors: first, is is simulated by +# 1. underlining is not allowed with colors: first, it is simulated by # black on white, second, it disables background color manipulations. # 2. BLINKING, REVERSE and BOLD are allowed with colors, # so we have to save their status in the static registers A, B and H -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org