Page 1 of 1

Windows 10 ANSI color

Posted: Thu Feb 07, 2019 11:22 am
by cameyo
The console in Windows 10 support VT (Virtual Terminal) / ANSI escape sequences but it is disable by default.
To activate it:
in registry key [HKEY_CURRENT_USER\Console], create or set the VirtualTerminalLevel DWORD value to 1.
(or from cmd.exe :

Code: Select all

reg add HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1
)
To deactivate it:
in registry key [HKEY_CURRENT_USER\Console], create or set the VirtualTerminalLevel DWORD value to 0.

You must open a new console window for changes to take effect.
For example use the ANSI color when debugging:

Code: Select all

(trace-highlight "\027[0;31m" "\027[0;0m") ;red text color

Code: Select all

(trace-highlight "\027[0;7m" "\027[0;0m")  ;negative
cameyo