How to change the color scheme in the new Windows Terminal

The color scheme in Windows Terminal can be changed by editing a JSON configuration file named settings.json.

In earlier versions of the Windows Terminal, this file used to be called profiles.json.

How to open settings.json

Use the shortcut Ctrl+, or choose Settings from the Windows Terminal menu.

Windows Terminal Menu

This would open settings.json in your default JSON editor. If you have not associated JSON file type with any editor the file should open in Notepad.

Editing the file should be fairly straight forward, but if you are unfamiliar with JSON, it might be a good idea to create a backup first. The file can be found in %LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState.

Choose a built-in theme

At the time of writing this article, Windows Terminal comes with the following themes:-

  1. Campbell
  2. Campbell Powershell
  3. Vintage
  4. One Half Dark
  5. One Half Light
  6. Solarized Dark
  7. Solarized Light
  8. Tango Dark
  9. Tango Light

Viewing the latest list of themes

If you want to see the latest list of themes, open the defaults.json file. You can open this file by holding the Alt key down while clicking the Settings option shown above. Defaults.json contains the default settings of Windows Terminal. This file is meant as a reference, you must not edit it. All our editing will be done in settings.json. In defaults.json, scroll down to the schemes list and note the name property of each of the schemes.

Editing settings.json

In settings.json, look for the defaults object inside profiles. Copy and paste the following key-value pair inside the defaults object; change the theme name as required.

"colorScheme": "One Half Dark"

colorscheme property added to profiles.json

If some other key-value pair is already in there, you have to put a comma after it. In the image, notice the comma after "fontFace" : "Cascadia Code"

The properties specified inside defaults are applied to all your profiles. It is possible to have one color scheme for PowerShell, another for Cmd, and so forth. For this add the color scheme property to the profile in question. The list of profiles is inside the list array. The beginning of the list array can be seen in the above picture.

 

Add and choose a third-party theme

Many Windows Terminal themes are available on the internet, for example here: https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/windowsterminal. Let us see how to add such themes to your settings.

Step 1: 

Choose a theme, screenshots for the above theme collection are here. Copy the whole code including the braces and paste it inside the schemes array.

// Add custom color schemes to this array
    "schemes": [{
                  "name": "Cobalt2",
                  "black": "#000000",
                  "red": "#ff0000",
                  "green": "#38de21",
                  "yellow": "#ffe50a",
                  "blue": "#1460d2",
                  "purple": "#ff005d",
                  "cyan": "#00bbbb",
                  "white": "#bbbbbb",
                  "brightBlack": "#555555",
                  "brightRed": "#f40e17",
                  "brightGreen": "#3bd01d",
                  "brightYellow": "#edc809",
                  "brightBlue": "#5555ff",
                  "brightPurple": "#ff55ff",
                  "brightCyan": "#6ae3fa",
                  "brightWhite": "#ffffff",
                  "background": "#132738",
                  "foreground": "#ffffff"
                }
            ],

This adds the chosen theme, Cobalt2 in this example, to our schemes list. For the exact name of the theme, see the name property. You can add more than one theme, they must be separated by commas.

Step 2:

The theme(s) that you add to settings.json is merged with the themes from defaults.json. The steps for choosing a theme is the same for user-defined themes and default themes. Go to profiles ➾ defaults, as earlier, and add the name of the color scheme there. In this example that would be: "colorScheme": "Cobalt2". Please refer to the Choose a built-in theme section.

Override select colors from a built-in theme

It is possible to change only some of the colors from a built-in theme. The colors specified in defaults.json can be overridden in settings.json.  As an example let us override the background color of One Half Dark theme.

Steps:

  • Open defaults.json as described above.
  • Note the name of the scheme and the properties which you want to override. In our example: "name": "One Half Dark", and "background": "#282C34".
  • Create a new scheme in settings.json with only the name and the properties which you want to change.

Here is how the schemes array would look in settings.json:

// Add custom color schemes to this array
    "schemes": [
                {
                  "name": "One Half Dark",
                  "background": "#171B1F"
                }
            ],

Set One Half Dark as the theme and save settings.json, you will see a darkened background.

2 thoughts on “How to change the color scheme in the new Windows Terminal”

  1. Ok, I see how you modified the background color for ‘One Half Dark’.
    But there must be dozens of other text elements besides the background color.
    I still have no clue about how to change the color of other elements.
    For example:
    I need a good color scheme for Julia, preferably with a light background,
    but when I tried ‘Tango Light’ more than half of Julia error messages were so light (on a light background) that they were very nearly invisible. I have no idea how to change
    the color of a specific type of text element that needs to be changed.

    1. Error messages are supposed to be brightRed in Tango Light. Most light schemes have some problem or other in Windows Terminal. Fixing it might require a bit of work. Try to figure out which color you are seeing and redefine it to something else.
      {
      “name”: “Tango Light”,
      “brightYellow”: “#999900”,
      }
      This redefines brightYellow to a very dark shade of yellow.
      This method will not work if the scheme has already redefined the color to something totally different. Then you will have to find the color by their hex value.

Leave a Comment

Your email address will not be published. Required fields are marked *