PowerShell is considering enabling VT support *unconditionally* in its conhost.exe sessions. Is it safe? #19326

Open
opened 2026-01-31 06:40:15 +00:00 by claunia · 0 comments
Owner

Originally created by @mklement0 on GitHub (Feb 6, 2023).

Description of the new feature/enhancement

Note: This isn't a feature request, but since it is also isn't a bug report, I chose this issue type.

PowerShell (Core) currently selectively disables VT support for calls to external programs when running in conhost.exe windows - unless the VirtualTerminalLevel value in HKEY_CURRENT_USER\Console exists and is nonzero (this value doesn't exist by default) - while enabling support for PowerShell-native commands.

This makes for an awkward asymmetry:

  • While"It ain't easy being `e[32mgreen`e[m." (a PowerShell-native command) properly renders the VT sequences,
  • python -c 'print(''It ain\''t easy being \x1b[32mgreen\x1b[m.'')' does not (unless explicitly enabled via the registry)

This is non-obvious, given that the exact same string is emitted in both cases.
Currently, unless VT support is explicitly enabled via the registry, the garbled It ain't easy being ←[32mgreen←[m. prints to the console.

By contrast, Windows Terminal already has VT support enabled unconditionally.

https://github.com/PowerShell/PowerShell/issues/19101 proposes making PowerShell (specifically, transiently, for its own processes and its child processes only) similarly enable VT support unconditionally.

@SteveL-MSFT wonders whether it is safe to do so:

  • Does anyone anticipate any problems if this were to be done?
Originally created by @mklement0 on GitHub (Feb 6, 2023). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Note: This isn't a feature request, but since it is also isn't a bug report, I chose this issue type. PowerShell (Core) currently selectively _disables_ VT support for calls to _external programs_ when running in `conhost.exe` windows - _unless_ the `VirtualTerminalLevel` value in `HKEY_CURRENT_USER\Console` exists and is nonzero (this value doesn't exist by default) - while _enabling_ support for PowerShell-native commands. This makes for an awkward asymmetry: * While``"It ain't easy being `e[32mgreen`e[m."`` (a PowerShell-native command) properly renders the VT sequences, * ``python -c 'print(''It ain\''t easy being \x1b[32mgreen\x1b[m.'')'`` does _not_ (unless explicitly enabled via the registry) This is non-obvious, given that the exact same string is emitted in both cases. Currently, unless VT support is explicitly enabled via the registry, the garbled `It ain't easy being ←[32mgreen←[m.` prints to the console. By contrast, _Windows Terminal_ already has VT support enabled _unconditionally_. https://github.com/PowerShell/PowerShell/issues/19101 proposes making PowerShell (specifically, transiently, for its own processes and its child processes only) similarly enable VT support _unconditionally_. @SteveL-MSFT wonders whether it is safe to do so: * Does anyone anticipate any problems if this were to be done?
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 06:40:15 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19326