Friday, August 5, 2011

Windows Console Colors

I just got bit hard by this, so I'm documenting for the future.

I want my cmd, powershell, and console2 colors to all be the same.  Sounds simple, but it's a bit confusing how this all works in windows.

Here's what you need to know:

  1. Your background and foreground color settings specify a color index: 0-15
  2. The actual color code associated with that index can be defined in 3 places: "defaults", "properties", and console2's settings.
  3. "Properties" overrides "defaults," and console2's settings override everything.
I wanted all my shells to have the powershell default colors.  Here's how you do that:
  1. Launch powershell
  2. Right click the window header and select "Properties"
  3. Click the 'Screen Text' radio button
  4. Copy down the index of the selected color box (should be 6, that is the 7th box)
  5. Copy down the color values of that box (should be 238,237,240)
  6. Do the same for 'Screen Background' (index of 5, color 1,36,86)
Now we'll make CMD use these colors:
  1. Launch cmd
  2. Right click the window header and select "Defaults"
  3. Click the 'Screen Text' radio button
  4. Select the index color box you copied down above (should be 6)
  5. Change the selected color values to the values you copied down above (should be 238,237,240)
  6. Do the same for 'Screen Background' (index of 5, color 1,36,86)
Now we'll make Console2 use these colors as well.  Console2 seems to automatically use the color indexes you defined in the "Defaults" settings but it wont use the color values you defined...  So you have to redefine them in Console2's settings:
  1. Launch Console2
  2. Edit > Settings
  3. Change the 5th index color box mapping to the value you copied above (the dark pink one to 1,36,86)
  4. Change the 6th index color box mapping to the value you copied above (the bronze one to 238,237,240)
Now all your shells will have the same colors, including custom shells you host in Console2 like VS or Ruby or git-bash.

Enjoy!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.