Enable colors in Windows CMD and Powershell
Enabling console virtual terminal sequences on Windows
Created Aug 2, 2024 - Last updated: Aug 2, 2024
Intro
On Windows the CMD and Powershell command prompt windows by defalt does not handle the virtual terminal sequences that can be used to define colors and other effects to the text that is printed.

Opening Registry Database
To enable the feature, we need to add a new key to the Registry Database.
Starting Registry Database program:
- Right click on the start button.
- Choose
Run
. - In the run window that opened type
regedit
. - Press enter.
The Registry Databsae Window should now open.
On the left side of the window you will have the hirachy of database. And on the right side of the window is the keys under that group.
Enabling feature
In the opened Registry Database.
- Navigate to the following group in the left side panel
HKEY_CURRENT_USER / Console
. - Then
mouse right click
on empty space on the right panel. - Under the
New
menu clickDWORD (32-bit) Value
. - Write the name
VirtualTerminalLevel
. - Double click on the new
VirtualTerminalLevel
item. - In the window that opens write
1
in theValue data:
field. - Click
OK
Now the handling of virtual terminal sequences is enabled for all CMD and Powershell command prompts.
If any prompts are currently open, then you need to restart them for the feature to activate.