Opportunity to change current tab color programmatically. #19461

Closed
opened 2026-01-31 06:44:00 +00:00 by claunia · 4 comments
Owner

Originally created by @rutexd on GitHub (Feb 25, 2023).

Description of the new feature/enhancement

Windows-Terminal needs an api/way to allow change current tab color. This should allow more flexibe behaviour of a Terminal.
For example, this would make possible using any custom shell (like nushell) change color on any command or path, like red color tab on ssh or green color tab on specific project path.

Proposed technical implementation details (optional)

There basically two ideas.

  1. Modify wt.exe to allow wt.exe to change current tab state.
  2. Adding env variable like wt-color (or something) that contols current tab color, if desired behaviour of wt.exe isnt possible.
Originally created by @rutexd on GitHub (Feb 25, 2023). # Description of the new feature/enhancement Windows-Terminal needs an api/way to allow change current tab color. This should allow more flexibe behaviour of a Terminal. For example, this would make possible using any custom shell (like nushell) change color on any command or path, like red color tab on ssh or green color tab on specific project path. # Proposed technical implementation details (optional) There basically two ideas. 1. Modify wt.exe to allow wt.exe to change current tab state. 2. Adding env variable like wt-color (or something) that contols current tab color, if desired behaviour of wt.exe isnt possible.
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 06:44:00 +00:00
Author
Owner

@j4james commented on GitHub (Feb 25, 2023):

There are already escape sequences you can use to change the tab color. For more information, see the discussion thread here: https://github.com/microsoft/terminal/discussions/14903#discussioncomment-5104434.

@j4james commented on GitHub (Feb 25, 2023): There are already escape sequences you can use to change the tab color. For more information, see the discussion thread here: https://github.com/microsoft/terminal/discussions/14903#discussioncomment-5104434.
Author
Owner

@rutexd commented on GitHub (Feb 25, 2023):

I dont sure i actually get it.
I tried to repeat all commands from thread above and none of them worked for me, they just being printed with no effect. I tried powershell and in in classical command line (ofc both inside of a Windows Terminal)

My terminal version is 1.16.10261.0 , so if i understand versionning of wt right, this should work.

@rutexd commented on GitHub (Feb 25, 2023): I dont sure i actually get it. I tried to repeat all commands from thread above and none of them worked for me, they just being printed with no effect. I tried powershell and in in classical command line (ofc both inside of a Windows Terminal) My terminal version is 1.16.10261.0 , so if i understand versionning of wt right, this should work.
Author
Owner

@j4james commented on GitHub (Feb 25, 2023):

I believe this functionality was added in version 1.15, so 1.16 should work. But if you're using Windows PowerShell (as opposed to PowerShell 7), you can't use the `e escape character, so you'd need to do something like this:

echo "$([char]27)[2;15;1,|"

Does that work for you?

@j4james commented on GitHub (Feb 25, 2023): I believe this functionality was added in version 1.15, so 1.16 should work. But if you're using Windows PowerShell (as opposed to PowerShell 7), you can't use the `` `e `` escape character, so you'd need to do something like this: echo "$([char]27)[2;15;1,|" Does that work for you?
Author
Owner

@rutexd commented on GitHub (Feb 25, 2023):

Hell yeah, this works.
Thanks! :)

@rutexd commented on GitHub (Feb 25, 2023): Hell yeah, this works. Thanks! :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19461