0

If I do not use tmux my terminal is the following:

~$ echo $TERM
xterm

If I use tmux by adding the following into .bashr

# tmux configuration
tmux attach &> /dev/null

if [[ ! $TERM =~ screen ]]; then
    exec tmux
fi

My .tmux.conf has a line set-option -g default-terminal "screen-256color", but the terminal is the following:

~$ echo $TERM
screen

This makes VIM ugly. How can I get the tmux to use screen-256color? Using gnome terminal on Ubuntu 14.02

chaos
  • 47,463
  • 11
  • 118
  • 144
user1135541
  • 731
  • 4
  • 9
  • 13
  • I also use VIM inside tmux and my TERM environment variable is also set to `screen` by default. This does not affect the colors in VIM however; everything looks just fine. Do you have `set t_Co=256` inside your .vimrc? Also see [this page](http://robotsrule.us/vim) for more information. – Benjamin B. May 06 '15 at 15:15
  • I do have line in .vimrc `set t_Co=256`. I am asking this question as an outcome of http://unix.stackexchange.com/questions/201779/vim-solarized-color-scheme-looks-wrong-when-using-tmux/201793#201793. Not sure why, but it messes up my VIM. – user1135541 May 06 '15 at 15:17
  • See [Getting 256 colors to work in tmux](http://unix.stackexchange.com/questions/1045/getting-256-colors-to-work-in-tmux) and also [tmux, TERM and 256 colours support](http://unix.stackexchange.com/questions/118806/tmux-term-and-256-colours-support) – Gilles 'SO- stop being evil' May 06 '15 at 22:22

2 Answers2

1

I do have the same problem (my set-option -g default-terminal "screen-256color" seems useless).

So, whenever I need 256 colors, I use tmux -2 to force it.

That ain't the solution, just a workaround.

apaul
  • 3,338
  • 1
  • 15
  • 15
1

Ubuntu 14.02 uses tmux version 1.8, apperently it does not support screen-256color, so to resolve I followed this advice:

https://stackoverflow.com/questions/25940944/ugrade-tmux-from-1-8-to-1-9-on-ubuntu-14-04

So:

~$ tmux -V
tmux 1.9a
~$ echo $TERM
screen-256color

And now everything works right.

user1135541
  • 731
  • 4
  • 9
  • 13