On Thu, Jan 20, 2011 at 04:31:22PM -0600, Stephen Prater wrote:
> I have completed a patch to tmux which enables 256 color support in  
> fbterm (or any other term that uses non standard 256 color escape  
> sequences) as well as xterm / etc.
> 
> It does this by honoring terminfo setaf / setab entries for escape  
> sequences on 256 / 88 color terminals.

This works, but I'm not sure it goes far enough.

I had another look and if we are going to use setaf/setab directly for
256 colour terminals, then I think that really tty_check_fg should do
the translation, like it does when trying to display a 256 colour on a
16 colour terminal.

So as well as the first if statement which checks for 256-on-!(256||88)
and converts to 16, there should be a statement to check for 256-on-88
and pass through colour_256to88 (in fact they could be the other way
round, if 256-on-88 else if 256-on-16).

Then tty_colours_fg just needs to skip the aixterm check on 256 colour
terminals and pass through to setaf.

> 
> i have a few questions.
> 
> - should there be a "ignore-terminfo" switch to forcibly set the  
> escape sequences to the xterm-256color standard?

I think either we use terminfo or we don't, no option for this.

> - i didn't change any of the stuff with aix terms because I have no  
> way of testing this to make sure I didn't break it.

aixterm colours are bright version of the ANSI colours, set by using
90-97 and 100-107 to SGR, they are supported by most modern terminals
try eg this in xterm:

$ printf "\033[93mabc\033[0;33mabc\033[0m\n"

terminfo has no way to detect it so as a best effort tmux assumes all
terminals which advertise >=16 colours support the aixterm set (so all
256 and 88 colour terminals).

> - it seems odd to have the magical mystery 48 / 38 numbers in calls to  
> tty_try_256 now.  I replaced them with #defines but left the values as  
> 48/38  is there a better way to do this?

I don't think we need defines here, they are only used once and will
never change. Better to extend the comment above where they are used,
but we don't need them anymore if using setaf/setab anyway.

> - is there a test suite I ought to run?  it works for me on both
> xterm256-color, 16 color console and fbterm - but that's about all
> I've got to test on.

No, no test suite.
                                                                                
                                                                                
      
> secondarily -
> 
> how does one submit a patch to this project?

Send it to the mailing list ;-).

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to