ITerm2 applies strange color to vim’s default

colorhighlightsitermterminalvi

When I updated my iTerm2 recently in November (the main release, not nightly-build), colors are rendered strange. Fortunately, I restored old iTerm2 in the trash can, and made a comparison.

In each of the four pictures, the left penal is a tex file, the right a cpp file, and the terminal's theme is always Tango dark, with no additional alteration.
In such order, they are: October iTerm2 with "default" color of vim's; October iTerm2 with "koehler" color of vim's; November iTerm2 with "default" color of vim's; November iTerm2 with "koehler" color of vim's.

Compared with the 1st picture, I am sure the 3rd picture has something wrong, but the 2nd and 4th are similar.
So it seems the "default" scheme of vim is rendered incorrectly, and I found that it is not the only color scheme affected, like "desert" is also different, but I am not going to post so many pictures here for sake of space.

So, is it true that iTerm2 makes some mistake in interpreting vim's color settings? If it doesn't, why is 1st and 3rd pictures so different, and what's wrong?
If it does, is there some way to make iTerm2 apply correct color for "default" in the old manner, since I like it (1st picture, right panel).
You might think me fussy, but I use vim in iTerm2 every day.
Or the best advice for me is that I never shall update and stick to old iTerm2 from now on?

old-default
old-koehler
new-default
new-koehler

Best Answer

Because set termguicolors in .vimrc is not set.

This is how I understand it; correct if I am wrong. A terminal emulator may either use ANSI colors or the terminal's own color palette. Mac's native Terminal can only achieve the former; iTerm2 can do both. With termguicolors off, iTerm2 uses ANSI colors. After termguicolors is set on, it uses its own GUI colors. Colors becomes more vivid, as is in the screenshot.

Only when I converted to "solarized" color scheme did this suddenly occur to me. Still, you can see in the picture, it seems that newer version of iTerm2 has lighter color. Never mind. I am a "solarized" fan now.

terminal gui color