Solarized background colour off in emacs under tmux

2

1

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!

Ashe

Posted 2012-03-16T23:50:09.460

Reputation: 123

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). – Ashe – 2012-03-16T23:59:20.400

… not totally fix it—it still doesn't discriminate some colours in the same way. Weird. – Ashe – 2012-03-17T23:23:43.393

Answers

3

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"

Steve McKinney

Posted 2012-03-16T23:50:09.460

Reputation: 146

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! – Ashe – 2012-05-24T13:23:54.537

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 https://github.com/sellout/emacs-color-theme-solarized/issues/104.

– Arjuna Del Toso – 2014-04-21T17:08:27.910