Resetting the terminal colors on Windows

I have no idea how I came to this point, but the yellow colors in my terminal (both cmd and PowerShell) are not bright yellow anymore. So I want to reset my colors back to the old values! Turns out that getting them back is not as straightforward as I had hoped...

The colors of my PowerShell admin windows are way more vibrant than my normal PowerShell window.

Install Color Tool by Microsoft

Fortunately, Microsoft has released a new terminal color tool which we can use to get the old colors back:

  1. Download the ColorTool program zip from: github.com/microsoft/terminal/releases/tag/1904.29002
  2. Extract the zip to a directory, like c:\tools\ColorTool\

Sweet.

Extract an existing color scheme

Let's extract the existing color scheme:

  1. Open up the terminal with the right colors (in my case it was the PowerShell admin terminal; win+x and then a).
  2. CD to the tool directory; cd /tools/ColorTool/
  3. Save the current color scheme: ./ColorTool.exe -o ./schemes/admin.ini

The color scheme is saved to the schemes directory and can be used later on.

Color by hand

You don't have to generate the color scheme. You can add a file named admin.ini to the schemes directory. The contents should look something like this:

[table]
DARK_BLACK = 0,0,0
DARK_BLUE = 0,0,128
DARK_GREEN = 0,128,0
DARK_CYAN = 0,128,128
DARK_RED = 128,0,0
DARK_MAGENTA = 1,36,86
DARK_YELLOW = 238,237,240
DARK_WHITE = 192,192,192
BRIGHT_BLACK = 128,128,128
BRIGHT_BLUE = 0,0,255
BRIGHT_GREEN = 0,255,0
BRIGHT_CYAN = 0,255,255
BRIGHT_RED = 255,0,0
BRIGHT_MAGENTA = 255,0,255
BRIGHT_YELLOW = 255,255,0
BRIGHT_WHITE = 255,255,255

[screen]
FOREGROUND = DARK_YELLOW
BACKGROUND = DARK_BLACK

[popup]
FOREGROUND = DARK_CYAN
BACKGROUND = BRIGHT_WHITE

Setting the color scheme as default

To reset the colors, do the following:

  1. Open up the PoweShell with the wrong colors.
  2. CD to the tool directory; cd /tools/ColorTool/
  3. Reset the color scheme and make it the default: .\ColorTool.exe -b -d -x .\schemes\admin.ini

Final thoughts

That's it! Our colors are back. BTW, the Color Tool comes packed with some schemes:

8 themes for you to enjoy.

expand_less