The config file is only run when the server is started. Your best bet is to put something in your .profile along the lines of:
if [ -n "$TMUX" ]; then case "$(tmux showenv TERM 2>/dev/null)" in *-256color) export TERM=screen-256color ;; *) export TERM=screen ;; esac fi On Thu, Aug 21, 2014 at 12:58:52AM +0800, Izumi Natsuka wrote: > Hello, > > I'm trying to enable 256color support in tmux(v1.9a), I have put the > following in my tmux.conf: > > > set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID > SSH_CONNECTION WINDOWID XAUTHORITY TERM' > > if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g > default-terminal screen-256color' > > set -g default-command "${SHELL}" > > It works fine, except when there is another session have created in a > different terminal: > 1. Ensure that there's no tmux session available, create a new tmux session > on tty(I'm using agetty, so TERM=linux), in this tmux session, TERM=screen > 2. Switch to another tty where Xfce is running on, run > xfce4-terminal(TERM=xterm-256color) and create a new tmux session, in this > tmux session, the TERM variable should be 'screen-256color', however it is > 'screen'. > > Similarly, without creating first session on tty(agetty) but in > xfce4-terminal, create second session on tty, both of the TERM variable in > tmux session are 'screen-256color' > > Is it possible to fix this? > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > tmux-users mailing list > tmux-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tmux-users ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users