Changing ANSI colors in Terminal on Macs
Posted by Michael on September 9, 2008 in General, Servers, Systems
Probably the most frustrating experience I have had with Macs so far is figuring out how to change the ANSI colors in Terminal (Terminal.app) so that I can read the outputs of man and most especially ls and comments in vi when colorization is activated and I have chosen a dark background theme.
I am using Mac OS X Leopard 10.5.4 at the time of this writing. These are the steps I took to fix that most hideous of all colors, dark blue on black background:
- Set your terminal theme colors to your liking
- Set up ls to colorize directory listings by default. There are two ways to do this: Either set the CLICOLOR Environment variable or add an alias for ls to include the -G flag. I chose the CLICOLOR flag:
export CLICOLOR=1
- Next up, install the ANSI color SIMBL plugin found here: http://niw.at: works of Yoshimasa Niwa. Make sure Terminal.app is closed while you install the plugin then relaunch Terminal to find under its main menu, “Color Preferences…”
- Finally, edit that dark blue away!
If you’re interested in tailoring the output of the colors even further, you can also export the LSCOLORS variable:
export LSCOLORS="exfxcxdxbxegedabagacad"
And then change according to the manual entry for ls (”man ls”):
| a | black |
|---|---|
| b | red |
| c | green |
| d | brown |
| e | blue |
| f | magenta |
| g | cyan |
| h | light grey |
| A | bold black, usually shows up as dark grey |
| B | bold red |
| C | bold green |
| D | bold brown, usually shows up as yellow |
| E | bold blue |
| F | bold magenta |
| G | bold cyan |
| H | bold light grey; looks like bright white |
| x | default foreground or background |
One final trick to get my bash shell exactly like I like it was to set the prompt. This can likewise be done by editing ~/.profile:
PS1="[\u@\h \W] ”

Stumble It!
1 Comment on Changing ANSI colors in Terminal on Macs
By Changing ANSI colors in Terminal on Macs : thegameoflove on September 9, 2008 at 4:26 pm
[...] Original Michael [...]
Subscribe
Follow comments by subscribing to the Changing ANSI colors in Terminal on Macs Comments RSS feed.