Tuesday, January 12, 2016

Registry settings for console styles

If you've ever used PowerShell, you'll recognize its distinctive white-on-blue color scheme. You might think that such styling is set by the program itself at runtime, but not for PowerShell. PowerShell is styled just like other console programs - by settings in the registry.

In HKCU\Console, you'll find entries that define the fonts and colors for normal console applications. You'll also see subkeys with names that look kind of like file paths. The entries in those subkeys apply only to programs with their EXE at that path. Therefore, PowerShell's styles are kept in:

HKCU\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe

If a program styled in this way is moved or renamed, it will receive the default styles because there won't be a corresponding subkey. Even launching the program with extra backslashes in its full path will cause it to lose its styles, a situation which prompted me to write this Super User answer.

No comments:

Post a Comment