Menu

#12 pal uses curious heuristics to determine wether to use color

open
nobody
None
5
2007-01-09
2007-01-09
No

The guilty code is at pal-0.3.5/colorize.c:36 (function color_term()).

Trying to enumerate the terminals that we think can produce colors is a Bad Thing TM. This doesn't work with new, custom or funky values of $TERM.

I am experiencing lack of color without anything funky (GNU screen is quite widespread, can do color and it is not checked for).

The correct behavior should be to check the appropriate entries in termcap or querying the terminal about its capabilities.

[ on a side note, i see that the code checks first for strncmp(term, "xterm", 5) and then for strncmp("xterm-color", 11), which is redundant.. and incorrect (xterm-color will always match if xterm matches, and xterm will also match if $TERM value is actually i.e. "xtermAAAAAAA" ..
All that piece really needs to be rewritten ]

Discussion

  • Fernando Vezzosi

    patch for terminfo lookup of color capabilities

     
  • Fernando Vezzosi

    Logged In: YES
    user_id=760374
    Originator: YES

    This patch uses terminfo to determine if we should use colors.
    It needs testing.
    File Added: pal_patch

     
  • Anonymous

    Anonymous - 2009-02-17

    Same for me, no color when using GNU screen, have to use --color command line argument.

     

Log in to post a comment.

MongoDB Logo MongoDB