247

I want to keep the windows' name fixed after I rename it. But after I renaming it, they keep changing when I execute commands.

How can I keep them in a static name?

starball
  • 20,030
  • 7
  • 43
  • 238
Xiezi
  • 2,949
  • 3
  • 21
  • 29
  • 8
    Seems like here's the solution: http://superuser.com/questions/306028/tmux-and-zsh-custom-prompt-bug-with-window-name – Anton Strogonoff Dec 20 '11 at 06:25
  • My massive tmux and zsh configs do something like this: https://github.com/richo/dotfiles/blob/master/tmux.conf https://github.com/richo/dotfiles/blob/master/zshrc Tmux disables auto updating, zshrc has a bunch of hacks to take a look at what I'm doing and update the title appropriately. – richo Jun 12 '11 at 16:51
  • 10
    set-window-option -g automatic-rename off – DebugXYZ May 12 '13 at 05:55
  • 159
    ```set-option -g allow-rename off``` – Abhaya Aug 12 '13 at 08:36
  • 20
    This question should be reopened. – Ian Vaughan Apr 25 '14 at 09:46
  • @IanVaughan Why? To get it closed under a different reason? – rene Jul 09 '14 at 21:57
  • 5
    @rene Nope, to remain open with an answer. Its a valid question, I had it, the OP had it, therefore others can/will have it. I found a solution to it, thus its a valid question with an answer. – Ian Vaughan Jul 10 '14 at 09:10
  • @IanVaughan I doubt people will vote to reopen Can you add the command that set's window name so that non tmux users get the idea that this is not a give me the code question? – rene Jul 10 '14 at 16:00
  • 1
    For just renaming the active window, `set-window-option -g allow-rename off` does the trick. I accidentally upvoted @Deshawn-willams 's answer there, but that did nothing. – Dmitri DB Oct 22 '14 at 00:30
  • 3
    I don't understand why this is closed either. It's a direct question about a tool that's mostly used by Software Developers. – yasith Jun 24 '15 at 18:59
  • 10
    This was the top result when I searched for this problem in Google. This should be reopened. It's a valid question. – wrangler Jul 14 '15 at 14:09
  • At least 72 people have found @Abhaya 's solution useful, let's get the answer actually recorded – wrongusername Oct 27 '15 at 16:23
  • @yasith: The site standards for topicality are ["problems involving... software tools commonly used by programmers ... and unique to software development"](http://stackoverflow.com/help/on-topic) There's nothing here unique to software development, a network administrator using tmux to manage a bunch of remote shells would do it in exactly the same way. – Ben Voigt Oct 28 '15 at 21:12

5 Answers5

174

As shown in a comment to the main post: set-option -g allow-rename off in your .tmux.conf file

preaction
  • 2,029
  • 1
  • 14
  • 5
  • allow rename allows me to rename?? I want to be able to manually rename, but I dont want the window name to change after my manual rename is done – Arnold Roa Feb 16 '16 at 15:26
  • 8
    This is actually exactly what I needed. It let the window be renamed automatically when launching a process, *but* prevent renaming once you have manually changed it. And you can re-rename it after. – Drasill Mar 09 '16 at 14:18
  • 5
    @ArnoldRoa Interestingly `allow rename off` in `.tmux.conf` does the trick indeed, and it is not the other option `automatic-rename off`, which I would expect. – Daniel Dinnyes May 08 '16 at 13:11
  • This worked for me! This should be the accepted answer – Nick Klauer Feb 23 '17 at 16:16
  • 5
    For people using **byobu**, you should actually change `~/.byobu/.tmux.conf`. – ostrokach Apr 20 '18 at 21:06
  • This doesn't work for me. Neither does `set-window-option -g allow-rename off` nor `allow rename off` from the comments above. – KLaz Dec 07 '18 at 11:21
  • If some who could not find file `.tmux.conf`. Create `~/.tmux.conf` if not exists (by using `touch ~/.tmux.conf`). or just use `vim ~/.tmux.conf` and save. – zhongjiajie Mar 13 '19 at 03:08
  • 2
    @ostrokach, thank you for the note! But still don't forget to press F5 to reload the configs ;) Took me some minutes to figure it out – DiKorsch Mar 02 '20 at 09:01
  • This also works within a tmux session. Typing your prefix key followed by a colon will allow you to type the command `set-option -g allow-rename off`. – Walker Hale IV May 10 '21 at 21:14
17

There is two way to disable automatic rename.

01. change .bashrc or .zshrc file and add this line

export DISABLE_AUTO_TITLE=true

02. or you can add this line to ~/.tmux.conf file

set-option -g allow-rename off
  • create it if not exist

  • Highly recommend the second option
  • Also you must reload the tmux config after changing the config.

This can be done either from within the tmux, by pressing Ctrl+B and then : to bring up a command prompt, and typing:

:source-file ~/.tmux.conf

Or simply from a shell:

$ tmux source-file ~/.tmux.conf
Mohammad Rajabloo
  • 2,567
  • 19
  • 20
15

As suggested on the Super User link, setting the following variable in your .bashrc or .zshrc seems to solve the issue:

DISABLE_AUTO_TITLE=true
Community
  • 1
  • 1
Jean Carlo Machado
  • 1,480
  • 1
  • 15
  • 25
8
# set-window-option -g automatic-rename off 
set-option -g allow-rename off

Comment the first one, and set the second one, in the ~/.tmux.conf It works for me.

Vicotr
  • 81
  • 1
  • 2
-6

In my .zshrc file , add the following config, it solved this problem.

DISABLE_AUTO_TITLE=true
yixing yan
  • 173
  • 1
  • 7