62

I haven't been able to apply any color scheme to iTerm2.

It looks like that the Basic Colors are applied, but the ANSI Colors are not (as shown in Preferences>Profiles>Colors).

Using Mac OSX 10.7.2. Any help?

6
  • So there is a bug in iterm2.... Use default item provided....
    – ZaB
    Commented Mar 11, 2012 at 22:10
  • Really any color you select? What is the Terminal Type selected in Preferences » Profiles » Default » Terminal under Terminal Emulation?
    – slhck
    Commented Mar 11, 2012 at 22:21
  • @slhck Report Terminal Type: xterm-256color Commented Mar 12, 2012 at 12:51
  • Try changing it to xterm and see if that works.
    – slhck
    Commented Mar 12, 2012 at 13:05
  • @slhck Changed to xterm and xterm-new and restarted. Nothing works. Commented Mar 12, 2012 at 13:14

8 Answers 8

109

I've been having the same issue and this is what seems to have solved it:

In your .bash_profile set CLICOLOR before setting TERM:

# Set CLICOLOR if you want Ansi Colors in iTerm2 
export CLICOLOR=1

# Set colors to match iTerm2 Terminal Colors
export TERM=xterm-256color

save bash file and source:

source ~/.bash_profile 

Then, in your iTerm2 Preferences > Profiles > Terminal > Report Terminal Type, set to either xterm-256color or xterm

Close iTerm2, restart it and type ls. That did the trick for me.

Good luck.


Catalina and ZSH

If using ZSH, which is the default shell in Catalina and later, use ~/.zprofile, instead of ~/.bash_profile.

5
  • it works very well for me
    – ajreal
    Commented Apr 22, 2013 at 19:27
  • 1
    exporting the CLICOLOR finally made colors appear in iTerm2. The preference had xterm-256color set, I wonder why this was tripping it up.
    – mguymon
    Commented Feb 12, 2014 at 21:18
  • if this doesn't work, that a look at the 2nd answer bellow about the contrast... Commented Jan 6, 2016 at 1:40
  • thanks so much - first time in my life I solved an issue after giving up - I started doing something else and then saw this answer out the corner of my eye, decided to give it one last go and BOOM - thanks again
    – danday74
    Commented Nov 25, 2020 at 10:11
  • I also have to change my color preset, for me Solarized Dark didn't work but Dark background worked. Preferences -> Profiles - > Colors -> Color presets Commented Jan 9, 2021 at 0:34
44

this is a really old question, but make sure your Preferences -> Profiles -> Colors -> Minimum contrast setting is not at the max... if it is and you've done what is suggested above, slide it to a lower setting and you should see the colors appear.

2
  • 1
    Works great, but it's Preferences > Profiles > Colors > Minimum Contrast
    – Niclas
    Commented Aug 1, 2017 at 18:32
  • You're a life saver. iterm has to many damn options.
    – mdgrech
    Commented Feb 18, 2019 at 4:15
18

I had the same problem and found a solution: Profiles -> Colors -> Minimum Contrast. If it's high, then you only get black and white.

3
  • i set this without knowing that it set all the colors to black & white, and this comment help me fix that. THanks!
    – Roy Rico
    Commented Jun 3, 2015 at 18:58
  • superb! it worked, what a ...flower! ... my iterm got setup like that by default. Commented Jan 6, 2016 at 1:39
  • Perfect! I slide everything back to 0 and everything is colored again. Thanks! Commented Sep 14, 2016 at 17:55
3

If you are using zsh and @sam3k answer didn't work for you - you should put those lines in .zshrc instead of .bash_profile

0

Several answers have mentioned the contrast setting. Even at about 60% of the way across my ANSI blue turned black.

Crank the contrast down before you look for other solutions; it is way more aggressive than I expected.

0

If both modifying .zshrc and turning down minimum contrast DIDN'T WORK, then also make sure that Cursor Boost value is small enough.

0

Added:

export CLICOLOR=1
export TERM=xterm-256color

To the following file:

~/.zshrc

I saved this and then I ran:

source ~/.zshrc

The color scheme was then applied.

Please not you will need to run the source command for every terminal window that was already open before you made the changes in the .zshrc file.

0

I had the same issue but had to change a Mac OS Preference for the color scheme to be persisted.

Opening 'System Preferences' and unchecking the 'Close windows when quitting an app' radio button worked for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .