-
-
Notifications
You must be signed in to change notification settings - Fork 562
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
feat: Set terminal title to indicate atuin tui is active #2215
base: main
Are you sure you want to change the base?
Conversation
a9c04cd
to
fd79e8f
Compare
fd79e8f
to
fe0f826
Compare
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 naively think that maybe we can output the OSC sequences from atuin search
. Then, we don't have to write the settings for each shell.
Also, it would be better if we could configure the title during atuin search
and that after atuin search
.
I like that idea and had considered it. The main thing I wasn't so sure about is, is what to set it back to, since each shell has some default (and different) title behavior I think. So just opted to do it per shell to start. Being able to just enable it with a setting would be great since most users likely don't care about it, and would be much easier by adding it to So do you envision a setting that toggles the behavior on/off, a setting for what the title is when the TUI is open (default to 'atuin' maybe), and another one for what to reset it to? Probably the title to reset to could default to nothing (so not change it), as many shells (like zsh) would auto-reset it on it's own anyway? |
First, I think we should make this feature opt-in, i.e. it would set the terminal title only when it is turned on by the configuration. The users can have their own settings for the terminal title. This feature overwrites the users' settings if it is enabled by default. The users who want Atuin to set the terminal title can enable this feature explicitly. Then, the user can set the reset sequence to the desired one.
Yeah, that would be what I suggest.
Yeah, or the toggling option can be omitted by allowing the title to be empty; the empty title means that the feature is turned off.
I'm not sure, but I think the terminal title is usually configured to be updated after a user command is executed. I'm not sure if we can expect that the shell settings will reset the title after each keybinding in general. |
Okay, I agree with this. I suspect the majority of users won't use it as it's mostly an accessibility thing, so opt-in totally makes sense.
I do match on "zsh" using talon, but can match on anything unique as long as something is set. I just double checked a vanilla terminal without my voice coding setup loaded and you're right, it's not set to zsh by default, it's set to the cwd.
Agreed.
Cool! Never heard of that. But ya, I'd probably just opt to not bother so special casing various terminals isn't required.
Ya that's simpler.
Okay, thanks for all the feedback. I'll work on adding it to |
Attempts to address #2214 for zsh. Currently this just naively changes the title to "atuin" and back to "zsh". The default zsh settings will auto update the title (unless using zsh setting
DISABLE_AUTO_TITLE="true"
), so possibly setting it back to "zsh" afterwards isn't even needed.afaict it's not possible to query the current title, so we can't switch it back to what was originally there. So I think this does run the risk of clobbering someones title, if they have set
DISABLE_AUTO_TITLE="true"
, in which case it may be best to have an atuin option that's default to off? I figured I'd send this PR to show the idea anyway, since it's working for my use case, and can start a discussion about how best to do it.