-
-
Notifications
You must be signed in to change notification settings - Fork 979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add env var DISABLE_AUTO_TITLE #383
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how I feel about this change. Pure isn't associated with OMZ in any way, so it feels a bit weird to support one of their settings.
There are two problems (more or less) with this approach:
- Undocumented behavior, a feature in Pure can be disabled by an environment variable completely unrelated to Pure
- The setting can only be enabled by setting the string explicitly to
true
which ties Pure to the (current) implementation in OMZ, other Pure settings can be toggled via 1/0 so this setting introduces an inconsistency as well
Could you also provide a bit more info about your use case? E.g. what problem are we fixing here. You want to be able to set the title, but why, what's the benefit? Etc.
Btw, I'd add that I'm aware that disabling the title can be useful. Personally I've run into title issues while using Pure over a serial console 😅.
pure.zsh
Outdated
@@ -56,6 +56,11 @@ prompt_pure_set_title() { | |||
# emacs terminal does not support settings the title | |||
(( ${+EMACS} )) && return | |||
|
|||
# respect oh-my-zsh disable auto title | |||
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid quoting the variable inside [[ ]]
, it's not required.
Hi @mafredri, You're totally right about the OMZ support. I don't think it makes sense to support every framework out there. On the other hand it took me quite a while to figure out why the title wouldn't change even if I set it manually. Hence this PR. I thought it made total sense to have that option in Pure. And it doesn't hurt that it has the same name as the OMZ framework. 😄 My use case is that with new macbook, the touch bar displays all the tab of terminal. it allows to change tab as quick as a keystroke (touchstroke ?). But if the title is a long PATH, it is basically useless because that's the only thing on the touch bar. I'll make the change to the PR. Let me know what you think and no hard feelings if this don't get merged. I've used Pure for a long time and it just made sense to contribute back. |
@@ -56,6 +56,11 @@ prompt_pure_set_title() { | |||
# emacs terminal does not support settings the title | |||
(( ${+EMACS} )) && return | |||
|
|||
# disable auto title | |||
if "$DISABLE_AUTO_TITLE" == true; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still requires the [[ ]]
around it.
@veggiemonk sorry for the delay! At the very least, for this to make sense in Pure, it also needs to accept Btw, there's another way to bypass setting the title:
@sindresorhus do you have any preference on this? |
@mafredri Well, the solution you gave is much better than this PR. It should be added to the README though because I spent some time looking for that and I didn't even think about it. Since most env var starts with |
I've added this to the Wiki: Disable Pure terminal title updates. I don't want to add it to the readme since that would sanction such practices and they could be considered supported. The user should be aware that this can break at any moment and we don't officially support it 😄. |
Using iterm2 on Mac.
This PR allows the user to set the title of the window/tab