I'm using tmux in OpenBSD (tmux in the base system of OpenBSD 6.1-beta), and I do some development on Linux hosts.

Whenever I log into a Linux host, it renames the current tmux window. This is what's displayed in the lower right-hand corner of my tmux window:

"root@pelleplutt: /hom" 10:51 17-Mar-17

Pressing prefix-W shows the full window name as

(0)  0: ksh93* "root@pelleplutt: /home/ubuntu" 

(this is after having logged into an lxc container I'm currently playing around with).

This is the name of the window even after having logged out of the Linux host, and it's a bit annoying that it sticks.

I'd like it to either (automatically) change back to whatever it was set to before logging into the Linux host, or to never change at all.

I've tried to disallow window renaming through using

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

in my .tmux.conf file, but that doesn't seem to prevent whatever it is that sets the window name from doing so.

Any ideas how I may properly disallow window renaming in tmux?

Additional info:

The OpenBSD tmux doesn't tell the version:

$ command -v tmux

$ tmux -V
tmux: unknown option -- V
usage: tmux [-2Cluv] [-c shell-command] [-f file] [-L socket-name]
            [-S socket-path] [command [flags]]

The PS1 variable on the Linux host (Ubuntu 16.04 in an lxc container) is set to

\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$

The allow-rename portion of the tmux manual:

allow-rename [on | off]
    Allow programs to change the window name using a terminal
    escape sequence (\ek...\e\\).  The default is on.

Doing printf "\ektest\e\\" sets the text which is displayed at the bottom left to test if allow-rename is on, but not if it's set to off.

  • @JigglyNaga No, it's .tmux.conf, sorry.
    – Kusalananda
    Mar 17, 2017 at 10:31
  • Odd, turning allow-rename off works for me. I've tried with tmux 1.8 and 2.1, using echo -e '\033ktest\003\\'. Does it have any effect if you set the option from the tmux command prompt?
    – JigglyNaga
    Mar 17, 2017 at 10:48
  • @JigglyNaga No, it doesn't. Unfortunately I don't know what version tmux the one in the OpenBSD base system is based upon, but the manual mentions both settings. Your echo command seems to freeze the pane, and I have to kill it manually.
    – Kusalananda
    Mar 17, 2017 at 10:54
  • tmux -V should tell you the version. I got that echo escape sequence from the allow-rename part of the tmux manpage. The remote machine presumably sets the title using the PS1 variable -- can you show what that's set to?
    – JigglyNaga
    Mar 17, 2017 at 11:53
  • The \[\e]0;\u@\h: \w\a\] in your $PS1is an escape sequence that sets the window title to $USER@$HOST: $PWD. Would removing that from the $PS1 in your tmux session be an option? Mar 17, 2017 at 12:26

2 Answers 2


From a thread in the tmux-users list asking about this:

allow-rename affects the window name not the title.

In your output from Prefix+w:

(0)  0: ksh93* "root@pelleplutt: /home/ubuntu" 

The "ksh93" part is what tmux considers the window name. It can be set by the escape sequence \033k...\033\\, and protected by the allow-rename option.

The "root@pelleplutt: ..." part is the title. It's set by the escape sequence \033[2;...\033\\, and tmux doesn't have an option to protect that.

To prevent the remote system from changing the title, you could remove that sequence from the PS1 variable:

PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  • Can't prevent it from setting the title, huh? That's unfortunate. I can change the value of PS1, but this container will be recreated from a standard image every once in a while, so it would have been better to simply disallow it from setting the title... However, now that I know what this text string is, I can reset it in my OpenBSD shell's PS1 at least...
    – Kusalananda
    Mar 17, 2017 at 12:34
  • how to achieve the same on non-debian distros like arch Linux?
    – Akhil
    Aug 28, 2019 at 13:01
  • @AkhilJ The same: remove those escape sequences from the environment variable.
    – JigglyNaga
    Aug 28, 2019 at 13:14
  • @JigglyNaga It's working but 2nd and 3rd panes are showing same old title. screenshot link: link Thank you.
    – Akhil
    Aug 28, 2019 at 13:28
  • @AkhilJ Please create a new question, including all necessary information to reproduce the problem, and what you've tried so far.
    – JigglyNaga
    Aug 28, 2019 at 13:30

it's changed option name. so type 'man tmux' and need to check command.

$ tmux -V
tmux 3.1b

$ man tmux


 automatic-rename [on | off]
         Control automatic window renaming.  When this setting is enabled, tmux will rename the window automatically
         using the format specified by automatic-rename-format.  This flag is automatically disabled for an individual
         window when a name is specified at creation with new-window or new-session, or later with rename-window, or
         with a terminal escape sequence.  It may be switched off globally with:

               set-option -wg automatic-rename off

You must log in to answer this question.

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