Saturday, November 12, 2005

Color in mutt from DarwinPorts is broken

Last night, I installed mutt-devel 1.5.11 from DarwinPorts. It worked wonderfully, but the colors didn't work. All I saw was black and white. I tried everything I could think of (yes, .muttrc had "color" directives). I tried to troubleshoot the problem through the archives of various mailing lists, but they offered no hints. I checked mutt -v to make sure that color was enabled. Sure enough, +HAVE_COLOR +HAVE_START_COLOR were in the list. Still, mutt color was broken.

This was my first attempt to get anything from DarwinPorts to work on Mac OS X, so I was a bit oblivious. As I further diagnosed the problem, I got annoyed that OS X vim also showed no colors. On top of that, ls -G showed no colors. Hmm, I see a trend.

Here's the history behind the problem. Last night as I was getting mutt to work on my shiny new iBook, I noticed that colors disappeared when I ssh'd into my desktop or home server. Both of those machines run Debian testing ("etch"). In my .bashrc on those two machines, I examine $TERM before setting the colors. I only accepted "rxvt" and "xterm" but OS X Terminal sets TERM to "xterm-color". I said to myself, "Self, just tell Terminal to identify itself as 'xterm' and colors will then work on your Debian machines." I listened to myself, made the change and the colors worked. What I didn't notice at that late hour was that they also broke everywhere else.

So, to get mutt and ls and vim to show colors again, I just told Terminal to identify itself as 'xterm-color' again and everything worked. To get my Debian machines working again, I simply added 'xterm-color' to the list of acceptable terminal types.

The moral of the story is: change settings in the system you know best.

No comments: