Tmux will not stop auto-renaming windows

For this to work for me I had to add this line to ~/.tmux.conf

set-window-option -g allow-rename off

For people running bash and landing on this result, the thing that sets the title is the PROMPT_COMMAND environmental variable, which some shared system annoyingly set. You can do that with unset PROMPT_COMMAND (e.g. in your .bashrc)


A likely cause for this is, that zsh is configured to update the window title when starting a program or issuing the prompt. This is done by using the terminal escape sequence \ek<TEXT>\e\\ where <TEXT> is the window title.

To prevent this you have two options:

  • Disallow window renaming in the tmux configuration.

    Just add

    set allow-rename off
    

    to your ~/.tmux.conf. This prevents any program from changing the window title by using the aforementioned terminal escape sequence.

  • Track down the setting in your zsh configuration and disable it.

    If you are using oh-my-zsh, it should be enough to set

    DISABLE_AUTO_TITLE="true"
    

    in your ~/.zshrc (or just uncomment it, if you are using the default .zshrc template from oh-my-zsh).

    If you use your own configuration or some other configuration framework, you should be able to track it down by searching for \ek (do not forget to quote the backslash if your search tool requires it).