1

Searching around, I found that it might be a problem with Tmux detecting the correct terminal mode, so I placed this in my .tmux.conf:

set -g default-terminal "screen-256color"

Together with alias tmux="tmux -2" it makes some colorschemes work (badwolf for example), but not all of them (doesn't work for solarized, vividchalk and base16 for example). Since I wanted at least solarized, I installed it to gnome-terminal and to Vim. Colors show properly out of Tmux, but not in Tmux. I also set t_Co=256 (in Vim) but without success.

According to Tmux faq, there is nothing wrong with my configuration, but yet I can't get it to display properly. Any idea?

Update

To give a better understanding of the problem, below are some images.

First, Gvim (left) and Vim (right, in gnome-terminal): GVim | Vim

Second, Vim (left, in gnome-terminal), Vim with tmux (right, also in gnome-terminal): Vim | Vim with Tmux

Credits: the code is from Princeton Algorithms course (authors: Robert Sedgewick and Kevin Wayne).

Community
  • 1
  • 1
marcelocra
  • 2,094
  • 2
  • 24
  • 37
  • Can you add screenshots of what you want and what you get? Note that you should leave your terminal at 8/16 colors to make the best use of the over-engineered crap that is solarized. – romainl Oct 09 '14 at 07:32
  • Updated! I'm not sure, but solarized should work even with 256 colors, no? – marcelocra Oct 09 '14 at 21:18

2 Answers2

6

There are some steps required to solve this problem:

  1. Install the solarized theme for gnome-terminal, found here.

  2. Install the solarized theme for Vim (found here).

  3. Create an alias for the tmux command or set the TERM variable as mentioned in ianks answer (in your .bashrc):

    alias tmux="TERM=screen-256color-bce tmux"

  4. Include the following line in your .tmux.conf:

    set -g default-terminal "screen-256color"

I needed all these 4 steps to make my terminal colors show solarized. This post provides some other alternatives in case this doesn't work. One particular comment in that post helped the most, pointing to this resource.

It turns out that without setting the TERM variable, if you echo $TERM you see exactly what Tmux FAQ said you should (screen-256color), but you don't get the correct colors, don't know why.

Community
  • 1
  • 1
marcelocra
  • 2,094
  • 2
  • 24
  • 37
1

Have you tried adding this to your .(*)shrc?

export TERM=screen-256color-bce

Back when I used gnome terminal this worked for me, but don't ask me why :)

ianks
  • 1,708
  • 19
  • 15