4

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!

2
  • 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).
    – amelia
    Mar 16, 2012 at 23:59
  • … not totally fix it—it still doesn't discriminate some colours in the same way. Weird.
    – amelia
    Mar 17, 2012 at 23:23

2 Answers 2

6

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"

2
  • 1
    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!
    – amelia
    May 24, 2012 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. Apr 21, 2014 at 17:08
0

Here's my solution:

COLORTERM=truecolor emacs -nw

From: https://emacs.ch/@whhone/110340958779040888

2
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Dec 3, 2023 at 14:03
  • Please note my question is 12 years old at this point, but thanks.
    – amelia
    Mar 17 at 4:58

You must log in to answer this question.

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