InfiniteRed

art.through(code)

A black OS X Leopard Terminal theme that is actually readable

OS X Leopard was released with an updated Terminal application, which now has tabs, window groups, and many other new features. My excitement to replace the often slow iTerm was quickly extinguished as I realized that the new Terminal.app has some glaring problems:

  • The first is the inability to set the title of the tab as you do in iTerm, gnome-terminal, etc. That one I can live with, as there are work-arounds.
  • The other major problem is the horrible black themes that come with it (bad and worse). Apple is one of those companies who pay very close attention to visual details such as these, so it's surprising that they gave us such horrible choices.

So I decided to make a new theme, based on a subset of my popular TextMate theme IR_Black. The problem is the new Terminal app provides no way to set the ANSI colors; even though you can create your own themes (Settings), you can't change the colors. Ciarán Walsh provides a great solution to this on his blog, which uses the also great SIMBL.

Install Theme

  • Install SIMBL and TerminalColors following the instructions on Ciarán Walsh's blog. This is required for the color changes in my theme to work.
  • Download the theme file here.
  • Double click the IR_Black.terminal file, you downloaded, to install it.
  • Set it to be the default (if you want to always use these settings).

Screenshots

Example colors screenshot Example vim colors screenshot

Test Script

The following script will display the 16 colors in the terminal:

#!/bin/bash
echo -e "\\e[0mCOLOR_NC (No color)"
echo -e "\\e[1;37mCOLOR_WHITE\\t\\e[0;30mCOLOR_BLACK"
echo -e "\\e[0;34mCOLOR_BLUE\\t\\e[1;34mCOLOR_LIGHT_BLUE"
echo -e "\\e[0;32mCOLOR_GREEN\\t\\e[1;32mCOLOR_LIGHT_GREEN"
echo -e "\\e[0;36mCOLOR_CYAN\\t\\e[1;36mCOLOR_LIGHT_CYAN"
echo -e "\\e[0;31mCOLOR_RED\\t\\e[1;31mCOLOR_LIGHT_RED"
echo -e "\\e[0;35mCOLOR_PURPLE\\t\\e[1;35mCOLOR_LIGHT_PURPLE"
echo -e "\\e[0;33mCOLOR_YELLOW\\t\\e[1;33mCOLOR_LIGHT_YELLOW"
echo -e "\\e[1;30mCOLOR_GRAY\\t\\e[0;37mCOLOR_LIGHT_GRAY"

To install script:

  • Copy the script to your workstation, name it colors
  • Make it executable: chmod +x colors
  • Run it: ./colors

If there is an easier way to change the ANSI colors in Terminal, please let me know. Although I have had no problems with SIMBL, it's always better, if possible, not to use hacks.

Note: the color scheme I use for Vim in the screenshot above can be found here.

Share:
dzone del.icio.us digg it reddit spurl simpy blinklist furl blogmarks magnolia

  1. evilme  January 25, 2008 08:30

    Great Theme thanks!

  2. Jason L Perry  January 25, 2008 11:05

    Yes, thanks this is a great theme. Thanks!

  3. diabolo  January 25, 2008 17:06

    Love it, thanks

  4. Arthur  January 26, 2008 01:35

    Followed your instructions and everything worked great. I especially like the colors of your IR_Black theme.
    Thank you!

  5. Patrick  January 27, 2008 03:38

    Thank you so much, this theme is so nice.

    Greetings

  6. Peter Cooper  January 27, 2008 09:01

    Do you know if there's any way to get it so that you can select tabs with Cmd+ as you can in iTerm? I like the look of the new Terminal, but the lack of being able to jump between tabs easily has forced me back to iTerm :( In Terminal, it seems Cmd+ is only good for jumping between terminal /windows/ rather than tabs :(

  7. Todd Werth  January 27, 2008 14:38

    Peter, yes, I found that annoying as well. Ciarán Walsh has a solution for that as well, you can find it here:
    ciaranwal.sh/2007/12/10/tab-switching-in-terminal

    It allows you to switch tabs using ⌘1-9 like in iTerm.

  8. karl  January 28, 2008 01:41

    Or you could have just used LS_COLORS in your .bashrc

  9. Todd Werth  January 28, 2008 08:55

    Karl,

    LS_COLORS just changes the output colors of the ls command. It doesn't affect anything else, such as vim's colors in the screenshot above. You can set, for example, keywords in vim to be blue, but that doesn't affect how you see the color blue in Terminal.

    You only get 16 colors in Terminal, it's a shame if some of them are unreadable.

    If all you want is ls to output something other than blue for directories, then setting LS_COLORS is a good option.

  10. Rob O  January 28, 2008 22:18

    Great theme, Thanks!

    In your screenshots the text looks thinner than on my screen (Mine looks bold). Did you change your text at all?

  11. Todd Werth  January 29, 2008 08:12

    Rob,

    I have mine set to Monaco 12pt, normal/use bold fonts/don't use bright colors for bold text. The settings are in the .terminal file, so they should have come along with the theme.

    I did notice that it looks different on different machines, depending on your monitor and your "Font smoothing style" settings. I have a Dell 20" and an HP 23", on two different machines, and the HP looks less bold than the Dell.

  12. Kevin Marsh  January 29, 2008 08:41

    Very nice... I'm not sure where I got it from, but I've always used this little bash script for checking colors in the Terminal: pastie.caboo.se/144897

    Kevin

  13. Kevin Marsh  January 29, 2008 08:53

    Sorry for the double comment, I thought I'd post a screenshot of how I adapted your theme:

    www.flickr.com/photos/kevinmarsh/2228953878/

    Using Panic Sans 10pt (from Coda), and rgb(43, 43, 43) for the background.

  14. Stef  February 06, 2008 05:01

    Looks great - but I can't get it working. I would have said that I did everything correctly. But.... I installed the SIMBL. I put the TerminalColors into /Lib.../Appli..Supp.../SIMBL/plugins. I downloaded your theme and double-clicked it... It displays the black background, but no different colors within the terminal window. Any idea why this would be?

  15. Stef  February 06, 2008 05:03

    Just found it: one needs to add

    export CLICOLOR=1;

    to .bash_profile as indicated here ( www.aidanf.net/blog/2008/01/29/improving-leopard-terminal )

  16. Stef  February 06, 2008 05:08

    Oups, sorry, another one: it doesn't display the "computer_name.. user$" in a different color. How can I change that? And is there a way to modify the different settings in a text file or so? Using for example a background color for directories or so? I can't see where I could edit this...

  17. Todd Werth  February 06, 2008 08:20

    Stef,

    I'm glad you got it working and it's nice that people are enjoying the theme.

    You may want to read my article on setting up bash, it can be found here:
    www.infinitered.com/blog/?p=19

    There is a lot of information, but you can get started quickly by using the example configuration files and tweaking them.

  18. daaku  February 12, 2008 11:26

    Do you know of a work-around to get TerminalColors working with 10.5.2?

  19. Todd Werth  February 12, 2008 11:57

    Daaku,

    I haven't updated to 10.5.2 yet, but in the comments section of Ciaran Walsh's post there is a work-around:

    ciaranwal.sh/2007/11/01/customising-colours-in-leopard-terminal

    Update: I noticed that Ciaran Walsh updated his plugins, so that they now work with 10.5.2: ciaranwal.sh/2008/02/12/terminal-plug-in-updates. Thank you Ciaran.

  20. Jeff  February 14, 2008 11:22

    I was able to get it to work all except for your screenshot of your ruby code. When I open an .rb file in either vim or pico I don't get the cool code coloring.

    Initially I didn't get the colors but I copied your .bash_login and .bashrc files according to your post at www.infinitered.com/blog/?p=19 and that worked. Also, I ran the "colors" test and it also displayed fine.

    Is there anything else I needed to do to get colors working in vim/pico?

  21. Duncan  February 14, 2008 13:22

    Great article. Could you post your vim colorscheme as well?

    Thanks in advance.

  22. Christian  February 15, 2008 10:35

    Anyone else having problems with SIMBL with the new 10.5.2 update?

    "Terminal 2.0.1 (v240) has not been tested with the plugin TerminalColours (null) (v1.0). As a precaution, it has not been loaded. Please contact the plugin developer (not the SIMBL author) for further information."

    Anyone have a fix?

  23. Christian  February 15, 2008 10:37

    Found the fix in the comments @ ciaranwal.sh/2007/11/01/customising-colours-in-leopard-terminal

  24. Todd Werth  February 18, 2008 14:58

    Jeff, regarding colors in vim/pico:

    I have no idea about pico, but vim supports colorschemes. gVim and MacVim are very flexible with syntax coloring; as flexible as TextMate is. Vim in the command-line, however, can only use the 16 colors Terminal supports. You turn it on (syntax on) and set your colorscheme (colorscheme foo) in your vimrc or with a command at runtime; how to do this is out of scope of this comment, but the vim documentation explains it all.

  25. Todd Werth  February 18, 2008 15:15

    Duncan,

    The colorscheme I use in the screenshot is a vim version of my TextMate IR_Black theme. It's not 100% refined yet, but it works well for many file types, including Ruby. It also works well in both the command-line and MacVim.

    I'll probably post it later when it's a 100%, but you're welcome to it now, you can get it at:
    www.infinitered.com/settings/ir_black_beta.vim

    * Update: I have now finished the Vim color scheme, you can find it here:
    blog.infinitered.com/entries/show/8

  26. Bill  March 16, 2008 22:06

    I've followed all the instructions. Using your bash files, setting up SIMBL and TerminalColours, but no luck. I get the "More" button with no issue, and I even get the correct output of the color script. I'm even getting coloring on the welcome banner and on the prompt as set in your .bash_profile file. But I'm not getting any color on directories, or files. It's late, maybe I've missed something...

  27. Jun  March 19, 2008 18:53

    The colorscheme "ir_black_beta.vim" is perfect with MacVim. That is what I am looking for. Thanks for sharing it.

  28. Jun  March 21, 2008 16:30

    I find that the "Visual" setting in "ir_black_beta.vim" doesn't work well. So I change it from:

    hi Visual guifg=NONE guibg=#12132B ...

    to:

    hi Visual guifg=NONE guibg=darkgray

  29. Ed Kulis  May 02, 2008 14:51

    With no feasible way to save a terminal setings window size and location to an OS X folder this version of Terminal is unusable

  30. sean  May 22, 2008 16:17

    Nice work on this. I'm using your ir_black.vim theme currently.

    Would it be possible to get just the color values in a more standard format, like hex or rgb? Just a list is all I need to setup my linux terminal to match the ir_black.vim.

    I already tried looking in the .terminal file, which is just xml, but am not sure how to translate the <data></data> blocks to something more usable.

  31. Todd Werth  May 22, 2008 17:14

    Sean,

    Yes, they are listed as comments in the vim color scheme. For those that don't have the color scheme, you can download it here: blog.infinitered.com/entries/show/8

  32. sean  May 23, 2008 08:32

    thanks for the pointer, should of known to look there.

  33. Pieter  May 28, 2008 11:22

    Really great. Thx a lot!

  34. Kint  July 01, 2008 17:40

    Theme works great, looks awesome. I adjusted the blue color a bit, and for some reason the theme doesn't save my changes?! As soon as I quit Terminal.app and launch it again, I'm right back to the default, theme-supplied color.

    Help?

  35. Kint  July 01, 2008 17:48

    Please disregard the above, I am a raging idiot.

Leave a new comment:    * = Required

*
 (will not be shown)

*
*