To start tmux on every shell login, the following was added to the ~/.bashrc (on the server):if [ $TERM != screen-256color ] && [  $TERM != screen ]; then    tmux attach || tmux new; exitfiI also want to change the window title to something like user@server (instead of user@localhost) when ssh into a host. Here's my ~/.tmux.conf:set -g prefix C-aunbind C-bbind C-a send-prefixset -g set-titles onset -g set-titles-string #Tbind-key o split-window -vbind-key e split-window -hbind-key w kill-paneset -g terminal-overrides 'xterm*:smcup@:rmcup@'As you can see, set-titles was set to on, but it doesn't work as expected.More informations:Outside of tmux:$ echo $TERMxtermInside of tmux:$ echo $TERMscreenshow -g: https://clbin.com/h7oDhtmux info: http://sprunge.us/XHCBAnd here're the logs when running tmux -vvvvv for a bit:tmux-client-8441.log: https://clbin.com/eFwFFtmux-out-8443.log: https://clbin.com/MSKZvtmux-server-8443.log: https://clbin.com/JXwRNIf I comment out the lines in ~/.bashrc, from my laptop, ssh to the server, the title bar shows correctly (quanta@server), then start tmux from there also works as expected.But if I want to start tmux immediately after login, the title bar remains to be quanta@Ubuntu after ssh.UPDATE Fri May 10 07:51:23 ICT 2013I have deleted the exit command in order not to close the shell session when the last tmux window is closed:if [ $TERM != screen-256color ] && [  $TERM != screen ]; then    tmux attach || tmux newfiThe strange thing is:ssh to server -> the title bar: quanta@Ubuntudetach from tmux -> the title bar switch to quanta@serverattach to tmux again -> the title bar still shows correctlyquanta@serverI'm not sure if it's related to the PROMPT_COMMAND environment variable or not:Outside of tmux:$ echo $PROMPT_COMMAND echo -ne \033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}; echo -ne \007Inside of tmux:$ echo $PROMPT_COMMANDecho -ne \033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}; echo -ne \033\\
tmux set-titles doesn't work?
tmux;xterm
Problem solved!To enable native xterm mouse scrolling in tmux, a lot of wiki, Q & A site, blog post suggest adding a line like:set -g terminal-overrides 'xterm*:smcup@:rmcup@'to ~/.tmux.conf. And it is the culprit.To allow xterm titles in terminal window, you also need to add the XT flag, something like this:set -g terminal-overrides xterm*:XT:smcup@:rmcup@Source: http://opennomad.com/content/goodbye-screen-hello-tmux