Back to: All Forums  tmux  -n has no effect?
31 Mar 2012, 22:43
Billgathen_pragsmall

Bill Gathen (28 posts)

When I do @tmux new -s panes -n shell@ or @Prefix : new-window -n shell@

the “-n shell” (or whatever name I choose) has no effect. Doesn’t complain, but the window gets the default tilde name.

Once I’ve created it, I can use @Prefix ,@ to name it whatever I like but finding it odd that the argument is being ignored.

I tried @new-window -N@ instead, and the error message (which flashes for about a second, then disappears) shows @-n@ being the correct syntax as well! Confusing.

I’m on a Macbook (10.7.3) running ZSH, Terminal and tmux 1.6 installed via Homebrew.

Thanks! Bill

[UPDATE] Oddly, both commands work correctly in the “top” examples later on: @tmux new -s panes -n shell “top”@, etc work fine.

03 Apr 2012, 13:26
Bphogan_pragsmall

Brian P. Hogan (140 posts)

That’s a little strange - mine works just fine on a 10.6.8 and 10.7.3 machine. All I can say is there’s something with your configuration. I’m not using zsh - perhaps since you’re not executing a default command in that window, something that zsh is doing is renaming the window. There’s an option in tmux.conf for turning off the “smart” renaming for windows that you could try.

03 Apr 2012, 17:35
Billgathen_pragsmall

Bill Gathen (28 posts)

I’m using oh-my-zsh, so it’s possible it’s doing some shenanigans under the hood I’m not aware of. For instance, it shows my machine as Bill@unknown08ef27a2 in the terminal title and in the tmux status bar.

When I fire up /bin/bash, the machine name straightens itself out, but @-n@ doesn’t start working. Odd. Even odder, the machine name stays correct even after I get out of bash, so that’s nice. :-)

Not a deal-breaker, just thought if there was a tweak I could do, I would mention it.

Thoroughly enjoying the book: thanks for writing it.

25 May 2012, 16:15
Personal_pensive-1_pragsmall

John Bateman (2 posts)

-n doesn’t work in iTerm2, well it does work, the window is named but it wont be displayed with the name you picked set it to.

Even using -, and manually naming it will appear only until you execute your next command.

All that being said, scripting between windows using break-pane and such to call a window by name will still work.

30 May 2012, 02:48
Bphogan_pragsmall

Brian P. Hogan (140 posts)

@John Bateman:

You may want to check your configuration. On my machine with tmux installed from Homebrew and iTerm2, the -n flag works fine.

18 Oct 2012, 09:09
Generic-user-small

Tim Littlemore (2 posts)

I’m seeing this too and also find that the name of a window changes back to ~ after running commands. I have to keep hitting @Prefix ,@ to rename the windows.

I’m using oh-my-zsh and RVM, so suspect either one of these could be at fault. Does anyone have any ideas where I should start looking?

22 Oct 2012, 14:11
Generic-user-small

Tim Littlemore (2 posts)

I found out about the auto-rename setting and disabled it with this in my ~/.tmux.conf file:

@setw -g automatic-rename off@

But I’m still getting the windows renamed whenever I run any command.

09 Apr 2014, 18:34
Joshua-2012_pragsmall

Joshua Steele (2 posts)

I know this post is pretty old, but I ran into this same problem. -n had no effect on naming a window. I am using tmux installed with Homebrew, iTerm2 and oh-my-zsh. I did some searching and found this post on GitHub: https://github.com/robbyrussell/oh-my-zsh/issues/908

Basically, you just set export DISABLE_AUTO_TITLE="true" in your .zshrc. So far, that seems to have fixed the issue for me.

  You must be logged in to comment