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

Change tab colour automatically based on tab title text using preset regex in settings #7906

Open
fusenuk opened this issue Oct 13, 2020 · 9 comments
Labels
Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@fusenuk
Copy link

fusenuk commented Oct 13, 2020

Description of the new feature/enhancement

The ability to preset what colour a tab would be by what text is in the title of the tab.

I regularly have multiple tabs open to different servers but also multiple tabs open to the same server at the same time. An example tab bar could look like

me@laptop, bob@serverA, bob@serverA, bob@serverB, bob@serverC

On top of that I regularly close and open tabs to 'serverA' or 'serverB' throughout the day. So the ability to choose a colour manually for an open tab is useful but the frequency I open and close tabs means it isn't very efficient.

I'd like to be able to put a setting in the settings file that is something like

"tabColours":
{
"serverA" : "red",
"laptop" : "yellow",
"server[B,C]" : "green",
},

Then when I open a new tab and connect to serverB, the tab would automatically switch to the colour green. If I disconnected from ServerB and the Terminal session title changed back to 'me@laptop' the tab colour would auto switch to the colour yellow from green.

Proposed technical implementation details (optional)

Supporting regex pattern matching would be nice but even if it couldn't do that and was just basic static text matching would be good.

@fusenuk fusenuk added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Oct 13, 2020
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Oct 13, 2020
@fusenuk fusenuk changed the title Change tab colour automatically based on tab title text using preset regex settings Change tab colour automatically based on tab title text using preset regex in settings Oct 13, 2020
@zadjii-msft
Copy link
Member

Okay this is a neat idea, but I'm going to tag this up as a possible extension idea. Thanks for the suggestion!

@zadjii-msft zadjii-msft added Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. Product-Terminal The new Windows Terminal. labels Oct 13, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 13, 2020
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Oct 13, 2020
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 16, 2020
@DHowett
Copy link
Member

DHowett commented Oct 16, 2020

Yup! Excellent extension idea. Thanks!

@uishon
Copy link

uishon commented Dec 2, 2020

A suggestion, support not just the title bar color but some additional (any?) profile attributes (e.g., terminal background color, image, etc.)

@luxzg
Copy link

luxzg commented Dec 4, 2020

As @uishon suggested, this should cover other visuals as well, it would nicely cover my case. With multiple tabs, I'd rather rely on backgrond color or image to differentiate quickly, as tab colors just don't pop to me as much. I've been toying with a thing (see 8471 closed link above) to have background that has some noticable graphics + text (eg hostname or IP) in background-image, to help me differentiate sessions easily. Looking forward to seeing progress on this!

@Hightmar
Copy link

Very good idea, I'm looking for a solution to do it.
Is it possible to know the status of this feature?

@zadjii-msft
Copy link
Member

There hasn't been any progress here, or any current plan either. There's a spec that's pretty close to this over in #15700 (for #5916), but that doesn't really cover the "tab title".

Otherwise, we've kinda just got this tagged up as an "extensibility" feature (though, we don't really have a plan for extensions either). Maybe someday in the future, a 3p dev could write a "terminal extension" that listens for tab title changes, and then can call some API to manually set the tab color for a control.

Otherwise, I don't think we have a good idea for how to align this feature with our current settings model 🤷

@perryrh0dan
Copy link

Is there already an API to change the tab color from a powershell script ?
I have some helper functions and it would be really cool to change the color from within those functions.

@zadjii-msft
Copy link
Member

There certainly is! There are probably some details around #6574 (comment) for the sequence you'd want to use

@perryrh0dan
Copy link

Awesome, thank you so much for. Really appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

7 participants