<<< Date Index >>>     <<< Thread Index >>>

Re: Mutt & 256 colors re-re-re-visited



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday, January 28 at 10:15 PM, quoth Mun Johl:
>c> > Unfortunately, no.  When I run mutt I do first set TERM=rxvt 
>prior to
>c> > launching mutt.  I have verified via executing a shell command from mutt
>c> > that the TERM is in fact set to rxvt.  I have also verified via a shell
>c> > command that the output of 'tput colors' is 256 .
>c> 
>c> $ infocmp rxvt | grep colors
>c> 
>c> What does it say?
>
>colors#256, cols#80, it#8, lines#24, pairs#32717

What matters here is not the terminal, but the library.

The code in mutt that makes this decision is in color.c, around line 
325:

    if (ascii_strncasecmp (s, "color", 5) == 0)
    {
        s += 5;
        *col = strtol (s, &eptr, 10);
        if (!*s || *eptr || *col < 0 ||
            (*col >= COLORS && !option(OPTNOCURSES) && has_colors()))
        {
            snprintf (err->data, err->dsize,
                _("%s": color not supported by term"), s);
            return (-1);
        }
    }

As you can see, when parsing something like "color34", *col becomes 
34, and is checked against the value of COLORS. COLORS is a value 
defined by ncurses and slang.

If the library doesn't support large numbers of colors, then mutt 
won't either.

~Kyle
- -- 
I would be delighted to offer any advice I can on understanding women. 
When I have some I'll let you know.
                                                    -- Jean Luc Picard
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFFvhZgBkIOoMqOI14RApRqAKCq2b0cB/oMI5Np8Z15//dGOapD6ACgznDy
c70qbsIUEWEDa0CUzbHgDu0=
=Sa5I
-----END PGP SIGNATURE-----