Home

Awesome

Solarized - Command Prompt theme

This is a Solarized color scheme for the Windows command prompt, with contributions by Neil Pankey, Ryan Beesley, Scott Hanselman, Russell West, and Paul Hampson.

See the Solarized home page for screenshots and more details, as well as color schemes for other applications. To contribute or file bug reports or issues, please visit the GitHub repo for this port, or the main Solarized repository.

Inspired by this post

Making Solarized work for cmd.exe, Bash on Ubuntu on Windows, and PowerShell, and striking a balance with how other Solarized projects are implemented presents some challenges. The following table shows how the colors are mapped.

SOLARIZEDHEXANSITERMCOLcmd.exePowerShellColorTableDWORD
base03#002b36ESC[0;30mbrblackBlackBlack0000362b00
base02#073642ESC[1;30mblackGrayDarkGray0800423607
base01#586e75ESC[0;32mbrgreenGreenDarkGreen0200756e58
base00#657b83ESC[0;33mbryellowYellowDarkYellow0600837b65
base0#839496ESC[0;34mbrblueBlueDarkBlue0100969483
base1#93a1a1ESC[0;36mbrcyanAquaDarkCyan0300a1a193
base2#eee8d5ESC[0;37mwhiteWhiteGray0700d5e8ee
base3#fdf6e3ESC[1;37mbrwhiteBrightWhiteWhite1500e3f6fd
yellow#b58900ESC[1;33myellowLightYellowYellow14000089b5
orange#cb4b16ESC[0;31mbrredRedDarkRed0400164bcb
red#dc322fESC[1;31mredLightRedRed12002f32dc
magenta#d33682ESC[1;35mmagentaLightPurpleMagenta13008236d3
violet#6c71c4ESC[0;35mbrmagentaPurpleDarkMagenta0500c4716c
blue#268bd2ESC[1;34mblueLightBlueBlue0900d28b26
cyan#2aa198ESC[1;36mcyanLightAquaCyan110098a12a
green#859900ESC[1;32mgreenLightGreenGreen1000009985

To make sure that the terminal is likely to use the best matching, the ColorTable is aligned with TERMCOL values. These values were pulled from PuTTY and other Solarized terminal profiles. This allows the same ANSI escape sequences to show the same in ANSI supported terminals. The PowerShell default colors are also matched for the $Host.PrivateData and PSReadLine to make them seemingly fit with the rest of the environments.

WARNING

Below are very simplified installation instructions. It will not update existing shortcuts because they have their own color mapping. With this latest version of the project, it is possible to apply to existing shortcuts, but it will not be easy to revert that change. It will not always play nice with traditional unix tools or compatability shims because Windows uses a fundamentally different color code mapping.

Installation

Update Registry for Console

While this was the original process, this only changes the registry default and doesn't update the Command Prompt and PowerShell defaults when you launch those shortcuts. It is still something you may wish to do, but the recommended process is now to use the Update-Link utility.

Import the .reg file of choice, e.g. regedit /s solarized-dark.reg.

Both files contain the same palettes, the only difference is the default foreground and background colors. Therefore you can switch between themes on the fly with color 01 for dark and color F6 for light.

Update Command Prompt and PowerShell shortcut .lnks

Locate the link you wish to modify, such as Command Prompt. The easiest way to do this on Windows 10 is to click Start, then type in the command you want to change. When it appears in the list, right-click and select Open file location. This will open an Explorer window and show you the shortcut. Hold shift and right-click on the shortcut, then select Copy as path. Now open a Command Prompt to the location of this project. In the Command Prompt window use this command.

Update-Link "<shortcut.lnk>" [dark|light]

The path to the shortcut.lnk is the same as you copied to your clipboard in the previous step. To easily paste it in Windows 10, just right-click on the window. If the path has spaces, you will want to wrap it in quotes, but if you followed the recommended way to use Copy as path, it will be done for you. If no theme is given, Update-Link will default to Solarized Dark.

Update your PowerShell profile

Copy the Set-Solarized*ColorDefaults.ps1 files to your profile directory, likely ~\Documents\WindowsPowerShell\. Then add the following line of code to the end of your Microsoft.PowerShell_profile.ps1 or profile.ps1:

. (Join-Path -Path (Split-Path -Parent -Path $PROFILE) -ChildPath $(switch($HOST.UI.RawUI.BackgroundColor.ToString()){'White'{'Set-SolarizedLightColorDefaults.ps1'}'Black'{'Set-SolarizedDarkColorDefaults.ps1'}default{return}}))

Uninstall

Registry for Console

The file windows-defaults.reg is provided to restore the command prompt colors back to their shipping defaults. The registry settings have been checked for versions of Windows back to at least Windows 7 and the values are the same.

To restore the defaults, import the .reg the same way as you applied it previously, regedit /s windows-defaults.reg.

Command Prompt and PowerShell shortcut .lnks

Unfortunately, this is not the easiest to revert right now. One way, which is not recommended for casual users is to edit the Properties of an open window. From there, you can edit the colors manually, using the table as a guide. If there is enough interest and demand, a future update may make it possible to apply other themes using the Update-Link utility, but for now it is not very easy to revert.

PowerShell profile

You will also want to revert any changes you made to your PowerShell profile. Just open the profile you created or modified and remove the code.

Screenshots

PowerShell Light

PowerShell Light prompt

PowerShell Dark

PowerShell Dark prompt

And for comparison purposes:

PowerShell Default

PowerShell Default prompt

Command Prompt Default

Command Prompt Default prompt