Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

conhost.exe console windows on Windows: cmdlets, e.g. Select-String, do not render VT (ANSI) escape sequences in their for-display output with direct input from native (external) programs  #20898

Copy link
Copy link
@mklement0

Description

@mklement0
Issue body actions

Prerequisites

Steps to reproduce

To recap the repro steps: The problem occurs:

  • on Windows
  • in regular console windows (conhost.exe), not in Windows Terminal
    • with the VirtualTerminalLevel registry value in key HKEY_CURRENT_USER\Console NOT manually set to 1, i.e. either set to 0 or - as is the default - with the value not defined.
  • with input from external programs
# From a conhost.exe console window on Windows,
# with the defaults (see note re `VirtualTerminalLevel` above).
cmd /c echo foo | Select-String f

Suboptimal workarounds:

Suspected cause, quoting @SeeminglyScience from #18294 (comment):

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

Expected behavior

foo

with f inverted, to highlight the matching part of the line.

Actual behavior

←[7mf←[0moo

That is, the VT escape sequence weren't rendered.

Error details

No response

Environment data

PowerShell 7.4.0 on Windows 11 22H2

Visuals

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.