DEV Community

Thomas Eckert
Thomas Eckert

Posted on • Edited on

Windows Terminal Color Schemes Roll Your Own Color Scheme in Windows Terminal

🚩 Disclaimer: I work for Microsoft. I am writing this purely as a fan of Windows Terminal.
Also posted on my blog.

At Build 2019, Microsoft announced an open source terminal for Windows. On 21 June 2019, it became available for preview in the Microsoft Store. I have been playing with it since and while its features are laudable, every developer knows the most important aspect of a terminal is its color scheme.

Luckily, it's easy to write your own. From the Windows Terminal, select the dropdown at the right edge of the tabs. Select Settings. Alternatively, the default keybinding for accessing settings is Ctrl+,.

A Windows Terminal window showing the user accessing settings by the dropdown at the right edge of the tabs.

This will open up a JSON file with the settings for your Terminal in the default editor.

The JSON file for editing Windows Terminal settings edited using Visual Studio Code.

Navigate to the "schemes" key. Here a list of JSON objects map standard Unix terminal colors (except for magenta which is called purple) to HEX codes. Copy an existing scheme and paste it into this list. Now, you can edit the colors as you like. I chose to implement a color scheme from flatuicolors.com called V1. You can find the implementation in a Gist here.

Give your scheme a unique "name" value and set the "profiles" to use that scheme.

As you edit the scheme, the Terminal will update in real time. To check your scheme, I have found the following bash command useful:

for x in {0..8}; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo ""

This will display every text color on every highlight color. I used it to create this sample for the Gist:

Happy hacking!

Top comments (6)

Collapse
 
radjammin profile image
Jamin Shanti
Collapse
 
naikrovek profile image
Jeremiah Johnson • Edited

That's for the Windows Console, not the new Windows Terminal.

Collapse
 
lisonge profile image
松儿~~

Please consult,why your terminal tab color is dark color, my is Light Color??
how to change it to Dark Color?

Collapse
 
achaldesai profile image
Achal Desai

Windows dark mode

Collapse
 
ankittorenzo profile image
Ankit Torenzo

The bash command you've provided in the post. I'm not able to use that command in PowerShell window. Please help.

Collapse
 
teckert profile image
Thomas Eckert

Certainly! bash refers to a particular type of shell, different from PowerShell. While I don't know how to reproduce the exact same output in PowerShell, a fair replacement is the command

[enum]::GetValues([System.ConsoleColor]) | Foreach-Object {Write-Host $_ -ForegroundColor $_}   

Which will list all colors in your editor as so:

Terminal colors shown in PowerShell