Skip to content

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

Closed

Description

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

Activity

  1. added
    Needs-Triage
    on Aug 23, 2021
  2. added
    Issue-Bug
    on Aug 24, 2021
  3. ertyz commented on Aug 24, 2021

    @ertyz

    Is it ok on Windows 2016 LTS or not?

  4. Pekka-Kalevi commented on Sep 12, 2021

    @Pekka-Kalevi

    Should ANS.1 characters be filtered by Out-Default depending current host or do we need augment formatting engine? Anyway, no meta data should show in the screen view. Formatting engine need to know VT100 codes and discard them at need, when host can't understand them leaving data as it is. Some codes like `e[2J Clear-Terminal (at 80's Univac paper terminals did a form feed and discard any pending data - video terminals emulate that in good and bad), but many others don't on legacy host on Windows.

  5. daxian-dbw commented on Sep 13, 2021

    @daxian-dbw
    MemberAuthor

    ertyz I didn't try but I guess it will have the same issue on Windows Server 2016. But we will get it fixed before 7.2 GA

    Pekka-Kalevi It should be filtered out depending on current host.

  6. ghost removed
    Needs-Triage
    on Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugResolution-FixedWG-Engine-Format

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions