Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Possible Duplicate:
Getting 256 colors to work in tmux

I want to set my terminal to 256 colors. I normally use the Gnome terminal which is shipped by default in Ubuntu but I also downloaded Terminator and tried Xterm and all them return 8 when I call tput color inside Tmux.

How can I arrange to have 256 colors in Tmux inside Gnome terminal so I can use Vim's 256-color scheme?

share|improve this question

marked as duplicate by Michael Mrozek Nov 12 '12 at 23:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Try setting TERM to xterm-256color. –  jw013 May 9 '12 at 2:52
    
I found this, I added to the ~/.bashrc, working fine but once I tmux the setting goes off. –  Luis D Urraca May 9 '12 at 2:56
1  
That would be a tmux problem. –  Ignacio Vazquez-Abrams May 9 '12 at 3:20
2  
I found help in #tmux channel on irc.freenode.net. for 256 colors in tmux your 'echo $TERM' needs to return screen-256color and mine was returning screen. So i followed the instruction on this link wiki.archlinux.org/index.php/Tmux#Setting_the_correct_term and everything worked. –  Luis D Urraca May 9 '12 at 3:22
2  
@LuisDUrraca Please copy your answer to below and mark it as solved, thanks! –  invert May 9 '12 at 8:13

2 Answers 2

up vote -1 down vote accepted

Even though OP answered the question in the above comments, I'll add the details here for easy reference. The quick solution is to add the following to your .tmux.conf file:

set -g default-terminal screen-256color

For more detailed info, check out the Tmux page on ArchWiki, or this helpful answer to the same question.

share|improve this answer
    
It seems that having active sessions prevents new sessions from honouring the default-terminal option in .tmux.conf as well as passing -2 as a parameter to tmux. Killing all sessions seemed to solve this for me. –  Matijs Jun 30 at 13:43
    
This doesn't work for me. Neither does using xterm instead of screen work. –  trusktr Jul 17 at 2:16

There is also the -2 command line option for tmux - c.f. older question

share|improve this answer

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