On Sat, Oct 24, 2009 at 03:54:57PM -0400, Thomas Dickey wrote: > On Sat, Oct 24, 2009 at 07:20:28PM +0200, Nicholas Marriott wrote: > > On Sat, Oct 24, 2009 at 12:49:31AM +1100, Tim Allen wrote: > > > On Fri, Oct 23, 2009 at 01:24:00PM +0100, Nicholas Marriott wrote: > > > > It appears screen-256color converts colours 8-15 into 90-97 which are an > > > > extension designed to allow bright colours without the bold attribute > > > > (bold > > > > font). > > > > > > Looking at xterm's ctlseqs.pdf, it refers to these 90-97 and 100-107 codes > > > as "aixterm" codes; I suppose before xterm invented the 88- and > > > 256-color hack, IBM had their own ideas about how to extend ECMA48 > > > beyond 8 colours. > > > > Yes, I know, but the question is why does terminfo bother itself converting > > 8-15 to 90-97 when it could just pass it through and get the same result > > since > > 90-97 are the same as 8-15 in the 256-colour palette. > > > > setaf/setab used to use the standard ANSI SGR sequence in xterm- and > > screen-256color, the change to use the 256-colour extension is relatively > > recent. > > as noted in terminfo.src > > # 2006-06-24 > ... > # * improve xterm-256color by combining the ibm+16color setaf/setab > # strings with SGR 48. The setf/setb strings also are cancelled here > # rather than omitted so derived entries will cancel those also -Alain > # Bench > > The improvement reduces the number of characters sent.
Ah yes, of course, I missed that. > Colors 8-15 use the aixterm SGR (which isn't "ANSI SGR"). Right. > 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. 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 suppose I could send the aixterm codes myself on 256 colour terminals but I'm not quite sure it is worth the effort. Plus 256 colours, default colours and mouse on/off are the only things for which tmux bypasses terminfo and I'd rather not add more. Actually I should use op to drop sending 39,49 directly as well. > > Actually, in the copy with ncurses 5.7, xterm-256color and screen-256color > > both > > have the same setaf/setab caps (inherited from xterm+256color). Debian must > > be > > on an older revision or have a local change. > > older... > > -- > Thomas E. Dickey > http://invisible-island.net > ftp://invisible-island.net -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org