Skip to content
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

Is it possible to have a hybrid title? #4436

Open
MostHated opened this issue Nov 16, 2020 · 10 comments
Open

Is it possible to have a hybrid title? #4436

MostHated opened this issue Nov 16, 2020 · 10 comments

Comments

@MostHated
Copy link

Hey there,
I was wondering if it's possible to have a mixture of the dynamic and fixed title. Example being:

___________________________
| Directory - Alacritty    |
---------------------------

Where the first part of the title remains dynamic but has a fixed "- Alacritty" at the end.

The reason being is I have scripts and launchers that look for the text in the title bar for different things, such as I use AutoHotKey to use Windows Key + f12 for terminal, if it's already launched but not visible it restores the window to view, if it is currently in view, it will minimize it, if it doesn't detect one at all, it launches a new one. I wanted to extend this a bit based on the directory the terminal is currently in, but with the current settings (as far as I can tell) I can only do directory or fixed title and not both. Is there a way to accomplish this already built in that I am just not seeing by chance?

Thanks,
-MH

@chrisduerr
Copy link
Member

Using scripts to detect application based on the window title is the problem here, not the inability of Alacritty to have its name in the title.

If your terminal applications change Alacritty's title to something you don't like, you should be able to just disable the dynamic title feature and it would work just fine?

Is it correct that you're running Windows?

@kchibisov
Copy link
Member

Well, we may provide a format string for title, but I'm not sure if there's a huge demand for it. Could look like

window.title_format: "Alacritty - {}"

@chrisduerr
Copy link
Member

Is there any other terminal doing that? A format string just seems pointlessly complicated. And there should be no need for Alacritty to keep Alacritty in its title.

Every desktop environment should be aware that Alacritty is Alacritty. The window icon is there, it should be very clear to the user, every interaction should be based on the application itself, not the title. I see no necessity to keep the name of the application in the title?

And even then dynamic_title can still be disabled if you're out for some kind of hack. But a hack isn't a good reason to implement a feature.

@MostHated
Copy link
Author

MostHated commented Nov 16, 2020

I was/have been using Terminus, which had this type of functionality, but I have been having a decent enough amount of issues with it displaying things properly, and in general just like Alacritty a lot more, so I was hoping to be able to reuse my current setup for the most part if possible. There were a few others that had a way to simply have the application name appended to the title, but not nearly as configurable as that, and really, I don't need it to be. I was just hoping to have the current directory followed by - Allacrity.

Seen here, near the bottom has the fixed suffix which could be appended to the end of the title at all times, which is what I was using to detect the windows.

@chrisduerr
Copy link
Member

I'm going to keep this open, but generally I don't like the argument that this is required for an AutoHotKey script. That's no justification to add this.

If there are any genuine arguments why this would be necessary or beneficial, I'd be happy to hear them though.

@MostHated

This comment has been minimized.

@chrisduerr
Copy link
Member

chrisduerr commented Nov 22, 2020

Terminal, or a shell? Either way that is completely unrelated to this, so please open a different issue if you're looking for help. But we have nothing to do with the shell.

@MostHated
Copy link
Author

MostHated commented Nov 22, 2020

I meant terminal, wasn't sure if there was a way to tell aside from it actually saying so in the title. No worries though if there isn't. Was just checking.

@Samgarr
Copy link

Samgarr commented Sep 26, 2021

Well, we may provide a format string for title, but I'm not sure if there's a huge demand for it. Could look like

window.title_format: "Alacritty - {}"

Another use case for this functionality might be using Alacritty with time tracker software like ActivityWatch which track usage of applications by window title.

@goyalyashpal
Copy link

goyalyashpal commented Feb 26, 2022

hi, so, why not do it with bash shell's PS1 environment variable? so:

  • the "\[\e]0;\w\a\]" is for setting title, here \w stands for current directory
  • so, you can put whatever text you want to be there
  • but yeah, this method works only with bash (& compliant others)
PS1="\[\e]0;\w - TEXTGOESHERE\a\]"
PS1+=
...

Play the foll vid @2x 😅 (yes, it's supported right here in browser)

7kCDUhsOzw.mp4

for personal reference: ^⇧c for copying in alacritty , ref: #5202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

7 participants
@Samgarr @MostHated @chrisduerr @goyalyashpal @kchibisov and others