If you have to specify "tmux -2" then something is wrong with your environment. 
That says your terminal supports 256 colors but isn't declaring it correctly.

With OS X 10.7+ and the Apple Terminal, configure "xterm-256color" support. 
This is done in Preferences -> Settings -> Advanced -> Declare Terminal As. I'm 
not sure about prior versions.

With iTerm2 set this in Preferences -> Profiles -> (Default or another profile) 
-> Terminal -> Report Terminal Type.

This correctly declares the environment variable $TERM as "xterm-256color". 
When tmux sees this it will automatically enable 256 color support, no "-2" 
needed. Programs running inside of tmux need the "screen-256color" setting you 
mentioned to see 256 color support.

If you are on an older Linux or UNIX system it may not have the 
xterm/screen-256color terminfo data. In that case you can grab the 
configuration file with:
> infocmp >> terminfo.src

then add the settings with:
> tic terminfo.src

If you do the first command from inside tmux you'll get the screen-256color 
settings, otherwise you'll get xterm-256color.

Here's a shell color test script from the vimwiki folks you might find helpful 
to verify 256 color support.

-Adrian

On Oct 30, 2012, at 6:38 PM, John Schmitt <marmalo...@gmail.com> wrote:

> On Tue, Oct 30, 2012 at 08:15:50PM -0500, Mark Volkmann wrote:
>> Just finished reading the excellent book "tmux: Productive Mouse-Free
>> Development"! I'm working on a Mac. The book indicates that the only
>> things I have to do to get 256 colors on a Mac are:
>> 
>> 1) run tmux from iTerm2
>> 2) add this to my .tmux.conf: set -g default-terminal "screen-256color"
>> 
>> However, it seems I need one more thing:
>> 
>> 3) start tmux with "tmux -2"
>> 
>> Is that last part really required?
>> ...
> 
> I found that it is required and that there's no setting for ~/.tmux.conf that 
> will remove the need for invoking tmux with "tmux -2".
> 
> John
> 
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to