24

Suddenly, both my screen/tmux started changing my windows' names after every command. They keep changing the name to the value of $PROMPT_COMMAND on every single action on the terminal, even after manually renaming them (by Ctrl+A A on screen or Ctrl+B on tmux).

On tmux I already tried to change the tmux.conf settings to disable window auto renaming off, but seems that it was ignored.

I am using bash without the standard /etc/bashrc configuration file. My distro is Fedora 18.

Paul Brinkley
  • 6,283
  • 3
  • 24
  • 33
user1363214
  • 301
  • 1
  • 2
  • 7
  • Possible dupe: http://stackoverflow.com/questions/6041178/keep-the-windows-name-fixed-in-tmux – Dave Feb 22 '17 at 14:41

4 Answers4

51

Add the following to your tmux config file:

set-option -g allow-rename off
Abid H. Mujtaba
  • 1,890
  • 1
  • 24
  • 20
35

Put this at the end of the .tmux.conf file:

set-window-option -g automatic-rename off
set-option -g allow-rename off 

then reload the tmux config file (ctrl + b > : > source-file ~/.tmux.conf).

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
realhu
  • 935
  • 9
  • 12
5

First, if l0b0's answer fixed your problem could you please mark it as a solution? Second, for those of use who stumble upon this question and are using fedora 19 this redhat bug report may be of interest. It seems like the default value of $PROMPT_COMMAND set by /etc/bashrc has been changed recently. I reverted to the previous behavior like this:

echo 'printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' > /etc/sysconfig/bash-prompt-screen
chmod a+rx /etc/sysconfig/bash-prompt-screen
ctrlc-root
  • 1,049
  • 1
  • 15
  • 22
2

Check whether your PS1 (plus PS2, PS3 or PS4 if those are set) is changing the title:

printf %q "$PS1" | grep -F '\\033'
l0b0
  • 55,365
  • 30
  • 138
  • 223