Let tmux set urxvt window title according to session-name

9

2

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 !

Bathz

Posted 2012-05-30T16:54:20.727

Reputation: 385

Answers

12

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

Jeremy W

Posted 2012-05-30T16:54:20.727

Reputation: 3 529

Hmm, it does not seem to be enough. It keeps displaying this boring "tmux". – Bathz – 2012-05-31T05:00:28.263

Ok, thanks having put me on the correct way. You first need to set -g set-titles on. Then you can customize the set-titles-string if you like. – Bathz – 2012-05-31T05:54:00.913

To be clear, if you include this to your answer I'll accept it, for posterity :). – Bathz – 2012-05-31T06:05:15.173

okay - I updated my answer and added some info on the character sequences – Jeremy W – 2012-05-31T14:21:25.977