microsoft / microsoft/terminal

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

Open
#7,906 9 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Extensibility Issue-Feature Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how tab titles, tab colours, and settings are represented in Windows Terminal. Define how configured text or regex patterns should match changing titles, including precedence and invalid settings; done means tabs automatically update colour when their title changes and the behaviour is covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.