Exhibit I: plain Emacs.

Plain Emacs.

Exhibit II: Emacs under tmux.

Emacs under tmux.

The shades of colours are different, and importantly, the background colour differentiation is nil (e.g. look at the top menu). Anyone run into this?

I'm running tmux as tmux -2, $TERM in tmux is screen-256color, I'm using color-theme-solarized dark in Emacs, and Solarized for iTerm2 … a bit baffled!

  • Strangely, setting TERM=xterm-256color inside tmux seems to fix it (in that the colours look right; I can't say for sure if something will mess up later or not). – Asherah Mar 16 '12 at 23:59
  • … not totally fix it—it still doesn't discriminate some colours in the same way. Weird. – Asherah Mar 17 '12 at 23:23

I was having the same issue in Vim. Using the following in my ~/.tmux.conf worked for me after creating a new tmux session:

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

| improve this answer | |
  • Wow, sorry! Forgot about your answer. I ended up settling on set -g default-terminal "xterm-256color". I'm not sure why, but it seems to have done the trick. Your answer got me there, though! – Asherah May 24 '12 at 13:23
  • 1
    tmux overrides the TERM value with screen-256color where instead you want xterm-256color for you emacs. If the tmux config trick doesn't work (it doesn't for me) you can alias emacs to "TERM=xterm-256color emacs -nw" in your .bashrc. See this bug report for solarized github.com/sellout/emacs-color-theme-solarized/issues/104. – Arjuna Del Toso Apr 21 '14 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.