Select-String doesn't render VT (ANSI) escape sequences in its for-display output with input from external programs on Windows
See original GitHub issuePrerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
This is a regression from 7.2.6 and only happens:
- on Windows (not on macOS; haven’t tried on Linux)
- in regular console windows (`conhost.exe), not in Windows Termional
- with input from external programs
cmd /c echo foo | sls f
Expected behavior
foo
should print with f
highlighted, to indicate what part of the line matched.
Actual behavior
←[7mf←[0moo
That is, the VT escape sequences are mistakenly rendered as verbatim characters.
Error details
No response
Environment data
PowerShell Core 7.3.0-preview.8 on Windows 10 21H2, Windows 11 22H2
Visuals
No response
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Is it possible to stop `powershell` wrapping output in ANSI ...
OutputRendering = 'PlainText' is in effect, you can suppress rendering of the ANSI escape sequences in the stdout output from external programs, ...
Read more >Enable ANSI escape sequence within Windows 10 console
Starting with Windows 10, the console supports ANSI escape sequences, but only if the console is configured to NOT "use legacy console", and...
Read more >about ANSI terminals - PowerShell
Describes the features of PowerShell that use ANSI escape sequences and the terminal hosts that support them.
Read more >ANSI escape code
ANSI escape sequences are a standard for in-band signaling to control cursor location, color, font styling, and other options on video text terminals...
Read more >Terminal I/O | I/O Device Guide
Using Terminal I/O, your routine can: Enable or disable the echo of incoming characters. Send and receive ANSI-standard escape sequences. Control keyboard ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would guess it’s related to #16612 but I’ve looked it over and I can’t easily see how. We should be re-enabling VT more often rather than less, so something is a little off for sure. /cc @daxian-dbw
This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.