Let tmux set urxvt window title according to session-name

Everyday I launch a bunch of urxvtc -e tmux.

I am trying to find a way to override urxvt X window title ("tmux") with the current tmux session name set via :rename-session session_name.

Does any of you guys achieved that ??

Thanks !


Solution 1:

Try adding the following to your ~/.tmux.conf file.

# Turn on window titles
set -g set-titles on

# Set window title string
#  #H  Hostname of local host
#  #I  Current window index
#  #P  Current pane index
#  #S  Session name
#  #T  Current window title
#  #W  Current window name
#  #   A literal ‘#’
set -g set-titles-string '#S:#I.#P #W'

# Automatically set window title
setw -g automatic-rename