-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Summary of the new feature / enhancement
The following environments on Windows already automatically (and invariably) support VT / ANSI escape sequences in output from native (external) programs, notably to produce colored output.
- Windows Terminal
- Visual Studio Code's integrated terminal.
By contrast, in console windows (provided by conhost.exe) the support depends on a registry setting that is OFF by default (Set-ItemProperty HKCU:\Console VirtualTerminalLevel -Type DWORD 1 enables it).
(Note: Some CLIs explicitly enable VT support for themselves, using the WinAPI, pwsh.exe and wsl.exe being examples; these do not depend on the registry setting, but all other ones do.)
Making VT support implicit (independent of the registry setting) even for native programs seems worthwhile, to align with user expectations and a modern terminal user experience.
Given that the change only affects how data is displayed, there shouldn't be a backward-compatibility concern.
Implicitly enabling support would also:
-
simplify the code, given that VT support is currently turned off and on demand, given that it must be enabled for PowerShell commands.
-
remove bugs in that context, such as Streamed executable output prints Ansi Escaping in Write-* Commandlets #18771 (which was inappropriately closed; a perhaps better repro is
cmd /c | Select-String Microsoft)
Proposed technical implementation details (optional)
No response