-
Notifications
You must be signed in to change notification settings - Fork 704
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
Feature Request: ability to set title and colour of a tab #2509
Comments
Since we use a native tab bar, I'm not sure what our ability is to color the tabs individually... @qwerasd205 do you happen to know off the top of your head? @tristan957 do you know what this is like on GTK/libadw off the top of your head? Additional question: when you set the title on iTerm, does it just ignore program requests to set the title? I assume so and will verify but if you know that'd be useful. |
@mitchellh yes, it does; the title never changes unless you change it yourself again. |
Speaking of tabs functionality, "Close tabs to the Right" is also very handy (Close Other Tabs as well) |
Coloring individual tabs on GTK/libadwaita should be pretty easy with the use of the runtime CSS and adding unique CSS class names to each tab. The difficult thing I think will be getting the UI/UX right. On iTerm2 is this functionality invoked by right-clicking on the tab, or by right clicking on the surface? If it's the surface it would be easy enough to add a menu item to our existing context menu. |
I believe coloring individual tabs for macOS should be relatively straightforward since we're already hacking the view hierarchy as is. My instinct would be to navigate up from the tab accessory view (which we use to display the key equivalents) to the tab container view and set the background on that. As a side note: I had the thought that automatically coloring tabs by the background color of the focused surface in that tab would be cool. |
You get the tab configuration popup/view when you right-click on the tab, not on the "surface" (iTerm2). |
After doing a little digging, setting the CSS for the tab bar title isn't going to be straightforward in GTK/libadwaita. Neither would be assigning a context menu to the tab bar. |
I went ahead and asked in the libadwaita matrix room |
Thanks! |
It is not possible, so we will not implement this in the GTK/libadwaita runtime. I wonder if there is some other way we could expose this metaphor for the runtime. |
Thanks for looking into it. We can at least point to the gtk/libadw teams as a source of this when we're asked about it. I think making this macOS only is fine. |
I wonder if tab groups would be a better feature vs colored tabs? |
Oof. That's too bad. Maybe using https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/method.TabPage.set_icon.html to set a icon that's a color block? |
It's a neat idea. I think we can maybe spin it out into a separate discussion eventually but I think maybe being able to specify an emoji icon instead to categorize. |
Also, looks like a context menu when you right click on the tab should be possible: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/method.TabView.set_menu_model.html |
I'll vote for the idea of renaming a tab. Never used coloring, so personally don't find it useful. I may run multiple different web services on a single machine and all the tab names represent commands that I used to launch those. So I can easily end up with three |
Just added #2529 which adds the ability to right-click in a GTK/libadwaita tab header and get a context menu. |
I assume this goes without saying, but having this as an action that can be triggered by a keybind would be tremendously helpful. |
Related but a bit different, I'm hoping to be able to use a generic fixed title for windows ("Ghostty"), but allow the title of each tab to automatically reflect the activity/contents. For ex. a window would be named "Ghostty", but each tab would have a different dynamic name based on which server I've ssh'd to in that tab. This is currently possible in the MacOS Terminal.app for example: Terminal.app title for windows: I noticed in this issue #1026 the following:
That's too bad if that's the case, Apple's Terminal.app CAN do separate window vs. tab titles, but maybe they're using some private code/api as they often do. |
maybe i missed it in the docs, but is there an option to use escape codes to set the tab title? similarly to: |
Should this issue be split into 2 issues:
One may be tricker than the other. I'm personally more concerned about the title. |
+1 on the tab title rename, I think it's the only feature missing for me, awesome tool 🫰 |
FWIW here's a current example of how I use kitty's tabs and its remote control to make it easy to find the tab I'm looking for: I use Peacock to set the color of a vscode window per directory, then direnv to look for the Edit: plus, keyboard shortcuts to move and navigate tabs. The hash and index number in the active kitty tab comes from here. |
Reading the comments here I understand it may be difficult to do for a tab, but if it would be easier to set the theme for an individual window (say by selecting one of several from the menu) that would still be useful. |
Would be nice if I could do this via bash, like in kitty:
|
+1 for per tab theme assignment |
+1 for tab titles It works by double clicking on title in ITerm2 |
Sets the title as a workaround |
Tab titles renaming is also the only thing missing for me as well. When I'm especially busy, I fallback to Gnome terminal for this |
+1 for tab titles, allowing for a keybind would also be great.
I think this is only a temporal fix, other programs (neovim, starship, etc) usually set a title like this too, so it will be overridden. |
Please avoid adding comments that mostly only repeat what has already been said before. We get a notification (maybe even an email) every time someone adds a comment, so please communicate your support by reacting with 👍🏼 instead |
@mitchellh thanks! Cool to have UI options for this. What's the recommended way to programmatically set the tab title in Ghostty? eg. using the zsh # Disable auto-setting terminal title.
DISABLE_AUTO_TITLE="true"
function precmd () {
echo -ne "\033]0;$(print -rD $PWD)\007"
}
precmd
function preexec () {
print -Pn "\e]0;🚀 $(print -rD $PWD) $1 🚀\a"
} Or is this not possible yet? Edit: Oh, it appears that it's maybe required to disable Ghostty's built-in shell integration using
# Disable Ghostty built-in tab title shell integration
# https://ghostty.org/docs/config/reference#shell-integration-features
shell-integration-features = no-title This seems to work for now: Screen.Recording.2025-02-15.at.17.36.47.movzsh config:
# Disable auto-setting terminal title.
DISABLE_AUTO_TITLE="true"
function precmd () {
echo -ne "\033]0;Custom title: $(print -rD $PWD)\007"
}
precmd
function preexec () {
print -Pn "\e]0;🚀 $(print -rD $PWD) $1 🚀\a"
} Also added to Command Line Tricks here: |
This is a really useful feature of iTerm2; I use different tabs for various projects and such, and being able to name them/set their title, and doubly so, being able to set a color, makes it a lot easier to switch to the right tabs and work with a tabs-based workflow.
The text was updated successfully, but these errors were encountered: