Fix hard-to-read colors in xterm

Jul 12, '04 07:30:10AM

Contributed by: Pausanias

I like running my xterms with a black background. I found that whenever a dark-blue color is used inside an xterm on my Mac, it is extremely hard to read for me. The same is not true on my Linux-based laptop -- there I don't have any trouble seeing the blue. If you are not sure whether you have this problem, but know what a .cshrc or .tcshrc file is, try running:

 emacs -nw ~/.cshrc
If you have trouble making out the color-coded setenvs, then read on. I did a man xterm and found out that you can change the default colors displayed in an xterm. To do this, however, you have to modify your .Xresources file. Open it up in your favorite editor:
 emacs ~/.Xresources
Then add these two lines:
 XTerm*color4: royalblue
 XTerm*color12: lightblue
Save the file and exit the editor. For the changes to take effect, either restart X11 or type xrdb ~/.Xresources. When you type the above code, only new windows will be affected by the changes -- old xterms you created before running xrdb will be unaffected.

Inside a newly created xterm, run the program that was giving you trouble to see the changes. If there are other colors that bother you, read the colors section in man xterm to find out which color numbers to remap. Finally, how did I find the names royalblue and lightblue? Right here.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040708210951539