Replies: 4 comments 3 replies
-
I moved this over to discussions! Sorry, we don't have clear signposts about what does where. 😆 Once I'm back inside work hours, I'd love to write up the pitfalls we've run into doing this... and what we're looking at doing to improve the situation going forward. I've added a TODO item! |
Beta Was this translation helpful? Give feedback.
-
Looking forward to the write-up. @o-sdn-o has found this comment of yours from a while back: #6634 (comment), which - if I understand correctly - implies that Windows Terminal has already decided to break backward compatibility with legacy CLIs that rely on the ability to "print raw control characters directly to the screen", correct? |
Beta Was this translation helpful? Give feedback.
-
Note that it also states, with respect to "Since taking ownership of the Windows command-line in 2014, the team added several new features to the Console, including background transparency, line-based selection, support for ANSI / Virtual Terminal sequences, 24-bit color, a Pseudoconsole ("ConPTY"), and more." That, combined with the quotes from my previous comment, suggests that it is ultimately So the question for PowerShell comes down to:
|
Beta Was this translation helpful? Give feedback.
-
(On a side note, it seems that when I post comments they are auto-up-voted, ostensibly by me - strange...) |
Beta Was this translation helpful? Give feedback.
-
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 theVirtualTerminalLevel
value inHKEY_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:
"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.
PowerShell/PowerShell#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:
Beta Was this translation helpful? Give feedback.
All reactions