The two common ways are to set default-terminal and not touch TERM elsewhere,
or to do something like
[ -n "$TMUX" ] && export TERM=screen-256color.
in .profile or whatnot.
You can do it whichever way you like.
On Wed, Feb 17, 2010 at 11:38:22PM +0100, frantisek holop wrote:
> hi there,
>
> i am trying to make tmux use 256 colors.
>
> i have found this:
> http://www.mail-archive.com/[email protected]/msg707066.html
>
> i have done step 2:
>
> $ xterm
> $ echo TERM
> $ TERM=xterm-256color
> $ tput colors
> 256
>
> but it is not clear to me how can i do step 1.
> what is the proper way to:
>
> "1) Set TERM=screen-256color inside so that applications INSIDE tmux know that
> it supports 256 colours, you can do this however you like but default-terminal
> is usually easiest."
>
> actually the man page states, somewhat misleadingly, that:
>
> The TERM environment variable must be set to ``screen'' for all
> programs running inside tmux. New windows will automatically
> have ``TERM=screen'' added to their environment, but care must be
> taken not to reset this in shell start-up files.
>
> what i have done in the end is to put
> TERM=screen-256color
> in my .kshrc that is referenced also by .profile's ENV
> but it doesn't feel 100% right.
>
> -f
> --
> there are 10 types of people: those that do binary, and those that don't.