Sometimes you need to not set the terminal title automatically.
For example when you use ZSH inside tmux or screen, it's a common practice to name tabs in a comfortable way to remember what's going on on each tab.
Is it possible to introduce a environment variable (or zstyle) to prevent automatic setting of the terminal title?
Thanks :)
Is there a way to detect if the title has been modified or some such? Or is
there a way to tell tmux to ignore the title when you set one manually?
Honestly that's where I think it belongs.
On vacation at the moment, but can take a look when I get back.
On Aug 27, 2015 10:41 AM, "Alessandro Molari" [email protected]
wrote:
Sometimes you need to _not set_ the terminal title automatically.
For example when you use ZSH inside tmux or screen, it's a common practice
to name tabs in a comfortable way to remember what's going on on each tab.Is it possible to introduce a environment variable (or zstyle) to prevent
automatic setting of the terminal title?Thanks :)
—
Reply to this email directly or view it on GitHub
https://github.com/sindresorhus/pure/issues/160.
Tmux does nothing particular.. It just picks the terminal title and when you manually set the title it just sets the terminal title to the new value.
I've tried commenting the zsh-add-hook lines and then I am able to manually set the title but ofc it's not a solution since I think it those hooks do other things and sometimes is good to have title automatically set.
Alessandro Molari
On 31 Aug 2015, at 17:28, Mathias Fredriksson [email protected] wrote:
Is there a way to detect if the title has been modified or some such? Or is
there a way to tell tmux to ignore the title when you set one manually?
Honestly that's where I think it belongs.On vacation at the moment, but can take a look when I get back.
On Aug 27, 2015 10:41 AM, "Alessandro Molari" [email protected]
wrote:Sometimes you need to _not set_ the terminal title automatically.
For example when you use ZSH inside tmux or screen, it's a common practice
to name tabs in a comfortable way to remember what's going on on each tab.Is it possible to introduce a environment variable (or zstyle) to prevent
automatic setting of the terminal title?Thanks :)
—
Reply to this email directly or view it on GitHub
https://github.com/sindresorhus/pure/issues/160.—
Reply to this email directly or view it on GitHub.
I can't actually reproduce the issue with tmux, after naming the window, it stays named that way:

Are you sure your issue isn't solved by setting set -g set-titles on in your tmux.conf ?
Yes it's not working.
I have that option enabled and also I've tried to manually set it:




Instead, when I comment the hooks it works correctly
It's a bit hard to look at your huge screenshots, but the message you're trying to convey is that _helloworld_ was replaced with _vim_? I really cannot reproduce this in tmux (2.0) though. Does it happen with anything other than vim as well?
Sorry for huge screenshots :)
Yes, it also works with other programs
I saw this, perhaps it could be a solution to your problems? https://github.com/tmuxinator/tmuxinator/issues/141
Essentially set-window-option -g allow-rename off?
If I run :set automatic-rename on I get the unwanted tab renaming behavior you're talking about.
I've tried to run both of the commands you mentioned but they doesn't work.
Plus, that would be just a workaround to the issue.
In any case, it doesn't work
You say this is a issue of pure, but as I see it it's an issue of tmux leaking the current title. I'm not quite sure how you're suggesting the behavior of pure should change.
For example: I definitely want pure to set the titles in tmux so that I can from the title spot what command is running. For me there is no issue with naming tmux tabs and getting the benefit of both: having a named tab and seeing the title.
What change are you suggesting we make to pure to accommodate you're use-case, and if this change requires feature detection, how do we do it? Is the screenshot I posted above not the best of both worlds?
I suggest to give the user an option to enable or disable automatic renaming of the terminal title.
If the user disables the renaming, the terminal title is never touched; otherwise, the behaviour is the current one.
This can be accomplished with an environment variable or (better) a zstyle configuration.
The zstyle configuration allows the user to dynamically turn on/off that feature.
The implementation should check that zstyle option every time it tries to rename the terminal title.
Not going to add an option in Pure for this. Happy to consider other solutions.
Why?
It seems a common usecase.
It's not an issue with Pure. The bar to add an option in Pure is very high as we're trying to keep it simple. "Just add another option" is the lazy way out.
Ok, if you don't care about the issue close it as won't fix.
But this is definitely an issue with Pure, because Pure overwrites the terminal title not some one else.
You're not going to add complexity to pure. If the option defaults to overwrite it'll have the current behaviour.
However, if the user uses tmux or other multiplexers, it will have the possibility to set terminal titles (i.e. window titles).
At the moment, what Pure is doing is an antifeature.
We've been trying to be accommodating but this is going nowhere.
Please read https://github.com/sindresorhus/pure/issues/160#issuecomment-140706292 again.
If you really want, you can easily maintain your own fork; I'm doing it for https://github.com/forivall/pure/tree/underline-repo-name
That's what I'm going to do. I've thought it is really dumb to maintain different forks for so small differences, but with these maintainers it's the only thing I can do.
It's pretty hard to help you when you're fighting us every step of the way. At least I'm happy you're now showing some interest in solving this yourself, good luck :)!
I use macOS Terminal that already has a better option to set the window title. Unfortunately I can't use that feature with pure, since latter doesn't have a simple way to stop setting the title. A new variable to enable or disable this would be really useful. Sad to see this issue won't be fixed.
@repoles it's not official, but: https://github.com/sindresorhus/pure/wiki#disable-pure-terminal-title-updates.
Thank you very much, @mafredri! I should have read the wiki ;)
Most helpful comment
@repoles it's not official, but: https://github.com/sindresorhus/pure/wiki#disable-pure-terminal-title-updates.