Skip to content

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

@mklement0

Description

@mklement0

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 Terminal
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-ExternalThe issue is caused by external component(s).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions