Thanks to visit codestin.com
Credit goes to github.com

Skip to content

$PSStyle.Formatting.TableHeader writes out the ANSI codes in a legacy console that doesn't support virtual terminal #15978

@daxian-dbw

Description

@daxian-dbw

Prerequisites

Steps to reproduce

Start PowerShell 7.2.0-preview.9 with a legacy console host (e.g. use 2012R2), and then run Get-Module.

Expected: The table view should not have any ANSI code written out.

Actual: ANSI codes are written out in the table view

issue-preview 9

Expected behavior

The table view should not have any ANSI code written out.
ANSI code should be ignored when the host doesn't support virtual terminal.

Actual behavior

ANSI codes are written out in the table view

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.9
PSEdition                      Core
GitCommitId                    7.2.0-preview.9
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions