Update Terminal Window Title with tmux
Window title changed to UnixTutorial in my Alacritty/tmux session
I have been using tmux more often than usual over the past few months, and realised that my basic tmux configuration was lacking a rather important functionality: automatic update of the iTerm2 terminal window tile based on the tmux context I was in.
Windows Title Settings in tmux
As always, tmux has got your needs covered and probably has more options for the things you didn’t even think about yet! Amazingly powerful software, this tmux thing.
So for windows title management, I added the following:
The first option instructs tmux to update terminal windows title (you need to also enable dynamic title updates in your iTerm2, Alacritty or Gnome Terminal).
The second one specifies format - I just want to know the name of my tmux window (tab names at the bottom of the screen). But it’s also possible to update it to include the current tmux pane name as well - I’m not enabling it yet but it would be configured like this:
Now whenever I’m switching between windows in tmux, this updates the title of the window - meaning I can see it easily when switching tasks in macOS.
See Also
Window title changed to UnixTutorial in my Alacritty/tmux session
I have been using tmux more often than usual over the past few months, and realised that my basic tmux configuration was lacking a rather important functionality: automatic update of the iTerm2 terminal window tile based on the tmux context I was in.
Windows Title Settings in tmux
As always, tmux has got your needs covered and probably has more options for the things you didn’t even think about yet! Amazingly powerful software, this tmux thing.
So for windows title management, I added the following:
The first option instructs tmux to update terminal windows title (you need to also enable dynamic title updates in your iTerm2, Alacritty or Gnome Terminal).
The second one specifies format - I just want to know the name of my tmux window (tab names at the bottom of the screen). But it’s also possible to update it to include the current tmux pane name as well - I’m not enabling it yet but it would be configured like this:
Now whenever I’m switching between windows in tmux, this updates the title of the window - meaning I can see it easily when switching tasks in macOS.