Make zsh shell-integration title changing toggleable by scripts after load time #3659
Unanswered
EightBitBoot
asked this question in
Feature Requests, Ideas
Replies: 1 comment 2 replies
-
I came across this post while desperately finding out why the title of my terminal keeps updating in a way I don't want to. Apparently it's Ghostty's shell integration that does that. For those who are wondering how to disable it, put the following in the configuration file:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When changing the current surface's title via ANSI escape escape sequences (
\e]0;My Custom Title Here\a
or\e]2;My Custom Title Here\a
), the zsh shell integration's_ghostty_precmd
and_ghostty_preexec
functions automatically overwrite it (I spent the better part of today tearing my head out and searching through the code thinking this was a bug in the terminal itself). This functionality can be disabled, however it must be disabled before the shell finishes loading and cannot be re-enabled (or disabled) at a later point.To work around this, a new environment variable has been added (only to the zsh integration for now):
GHOSTTY_SHELL_INTEGRATION_TOGGLE_TITLE_OFF
. This is settable by scripts and commands to disable the zsh integration's overwriting of the title and can be unset to re-enable the functionality.To take advantage of this, I have the following functions enabled in my .zshrc:
After taking a cursory look at the bash I don't believe this same method will be possible there (as it works by setting $PS0 and $PS1 to send the escape sequences).
For elvish I don't know enough to add the desired functionality.
My code is available here: main...EightBitBoot:ghostty:toggle_zsh_title_integration.
Beta Was this translation helpful? Give feedback.
All reactions