The behavior of a tmux window's name varies based on whether the window has been manually renamed. A window that has not been manually renamed actively refreshes to the name of whatever program is actively running (bash, vi, etc.), whereas a renamed window keeps its custom name even when the active program changes.

I would like to programmatically determine which behavior is being followed. In other words, I want to determine whether a window has been manually renamed. This would allow me to write scripts that say: "If the user has overridden the default window name, then respect the user's custom window name. Otherwise, override the default names in my fancy way."

Is this possible? I didn't see anything about it in the list of tmux variables.

1 Answer 1


When you rename a window manually, tmux will turn automatic-rename off in the window options for that window:

$ tmux -Ltest -f/dev/null new -d
$ tmux -Ltest show -w
$ tmux -Ltest renamew foo
$ tmux -Ltest show -w
automatic-rename off

So you could check for that.

It may be better to just set automatic-rename-format to the format you want and let tmux worry about whether the user has renamed the window or not.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .