question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select-String doesn't render VT (ANSI) escape sequences in its for-display output with input from external programs on Windows

See original GitHub issue

Prerequisites

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:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SeeminglySciencecommented, Oct 17, 2022

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

0reactions
msftbot[bot]commented, Oct 18, 2022

This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found