Setting up powershell terminal with the solarized colour pallete

Dec 21 2014

The default Powershell terminal brutal blue colour scheme is just wrong.

Solarized is designed with readability in mind. Powershell is quietly becoming a rather powerul terminal with a very good scripting language. Mostly, I use Powershell for Git, and I want my terminal to embrace the Solaried colours. How hard can this be?

You might be surprised. Trying to customise Powershell is just as frustrating as having to look at that default brutal blue all day. Perhaps I just haven’t happened upon the right google terms yet, but really, I feel like it should be a simple matter of tweaking some settings in my Powershell profile to get it all to hang together.

You can, of course, set the colours through the Properties menu of Powershell. That’s clearly archaic, to say the least. It’s also not very portable - if I could tweak my profile then I would have a simple git repository I could clone onto any new machine and have Powershell set up just righ. But no. I’m clearly missing something somewhere, because although I found some docs on the subject and had some minor success, I failed miserably in finding out how to fine tune everything; replacing the entire terminal background colour, for example eluded me.

Until I find a better way, here’s what I’ve fallen back on….and what I’ve discovered about the Powershell Terminal in my travels. It relies on a Powershell Shortcut’s propensity to take it’s initial settings from the registry, with colours being set by the brilliantly named ColorTable00 to ColorTabel15 DWORDs. Once internalised, the registry setting can safely be deleted.

Let’s get to it.

Create the registry entries

Adding items to the registry in Windows is pretty simple. Create a .reg file and include the info you need in it. The registry path you want is HKEY_CURRENT_USER\Console\ShortcutName. So, for the purposes of this demo, we’ll put the following in our registry file:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Console\SolarizedPShell]
"ColorTable00"=dword:00362b00
"ColorTable01"=dword:00969483
"ColorTable02"=dword:00756e58
"ColorTable03"=dword:00a1a193
"ColorTable04"=dword:00164bcb
"ColorTable05"=dword:00c4716c
"ColorTable06"=dword:00837b65
"ColorTable07"=dword:00d5e8ee
"ColorTable08"=dword:00423607
"ColorTable09"=dword:00d28b26
"ColorTable10"=dword:00009985
"ColorTable11"=dword:0098a12a
"ColorTable12"=dword:002f32dc
"ColorTable13"=dword:008236d3
"ColorTable14"=dword:000089b5
"ColorTable15"=dword:00e3f6fd
"ScreenColors"=dword:00000001
"PopupColors"=dword:000000f6

Save this and name it solarizedPShell.reg. You can include more info like font size and window size, but this is an exercise in the Solarized Powershell terminal so we’re going with the colours and nothing else.

Double click your .reg file to add the contents to the registry.

Create your shortcut

On your desktop, right mouse button and select New > Shortcut.

Create shortcut { .center-block}

In the wizard that pops up, type powershell.exe into the first textbox when prompted to “Type in the location of the item:“.

powershell.exe { .center-block}

Click Next and then give the shortcut the same name that you gave to your registry entry above (SolarizedPShell).

Naming the shortcut { .center-block}

Click Finish

Launch Powershell from your newly created shortcut and you’ll have a Solarized Terminal! Yay! Success!!

Internalizing the settings and getting rid of the registry cruft

To internalize the settings, click on the icon in the top left of your Powershell window. Select Edit->Properties and change some settings - the font perhaps - Consolas is nice!

Powershell properties {.center-block}

Once you click Ok to save your settings, your registry entry basically becomes obsolete. Don’t ask me where Windows puts the settings, but you should be able to remove the registry entry you made earlier without any ill effect.

Kudos

High praise to Neil for his original .reg file with the Solarized colour scheme.