By default, tmux will show the title of the focused pane in the status bar. After using rename-window to set a title manually, how do you restore the default behavior?

First idea was to set a blank title, which didn't work. According to the soruce code, it sets the window option "automatic-rename" to 0, but doing things like setw -g automatic-rename on doesn't seem to have any effect (aside from confirming that the option was set).

2 Answers 2

setw automatic-rename

This will work on Current window

setw -g automatic-rename

This will affect global session so all new window will be affected

  • This still does not restore any dynamically set window names while you had another name set, which is what I wanted (either restore old title, or revert to whatever was set last). But it doesn't look like this is possible without a patch so thanks anyways.
    – tripflag
    Sep 19, 2015 at 19:04
  • 4
    @tripflag, yes, it does. I've just tried it.
    – Atcold
    Oct 30, 2015 at 15:30
  • 5
    Just to make it clearer to everybody, you have to type your tmux prefix (commonly Ctrl-B) then colon : then your setw stuff
    – Davide
    Sep 27, 2016 at 21:43
  • 1
    Or tmux setw automatic-rename at the terminal. Apr 4, 2020 at 19:39

@Ahed-eid's answer works only when you use automatic-rename which, as I think, isn't OC's case.

The correct answer is to:

  • set allow-rename on - so your manual setting of window title can be overridden,
  • set automatic-rename on - when you want tmux itself to set window name and title through its mechanism of terminal inspection
  • set automatic-rename off - when you want to control window name and title from terminal (for example from a shell prompt)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.