Skip to content

Format-Table output breaks with VT100/ANSI escape sequences #2755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MartinGC94 opened this issue Jun 10, 2020 · 4 comments
Closed

Format-Table output breaks with VT100/ANSI escape sequences #2755

MartinGC94 opened this issue Jun 10, 2020 · 4 comments
Labels
Area-Extension Terminal Issue-Bug A bug to squash. Resolution-Duplicate Will close automatically.

Comments

@MartinGC94
Copy link
Contributor

System Details Output

### VSCode version: 1.46.0-insider 9f89da69154ac6c99dfa7c82986e2df95b7bbe0b x64

### VSCode extensions:
[email protected]

### PSES version: 2.2.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.19041.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

Output from Format-Table breaks inside the integrated console when you add vt100 sequences to change the colors. This works fine in every other terminal I've tried that supports this feature.
You can try this out with the following code:

$TableOutput=Get-NetIPAddress -AddressFamily IPv4 | Format-Table
$i=0
foreach ($Line in $TableOutput)
 {
     $FieldList=$Line.formatEntryInfo.formatPropertyFieldList

     if ($FieldList)
     {
        $i++
         if ($i%2 -eq 0)
         {
             foreach ($Property in $FieldList)
             {
                 $Property.propertyValue="$([char]27)[92m$($Property.propertyValue)$([char]27)[0m"
             }
         }
     }
 }
$TableOutput

Expected Behaviour

Expected

Actual Behaviour

Actual

@ghost ghost added the Needs: Triage Maintainer attention needed! label Jun 10, 2020
@SydneyhSmith
Copy link
Collaborator

@MartinGC94 thanks for opening this, we are able to repro this

@SydneyhSmith SydneyhSmith added Area-Extension Terminal Issue-Bug A bug to squash. and removed Needs: Triage Maintainer attention needed! labels Jun 11, 2020
@rjmholt rjmholt changed the title Format-Table output breaks with vt100 sequences Format-Table output breaks with VT100/ANSI escape sequences Jul 20, 2020
@corbob
Copy link
Contributor

corbob commented Jul 28, 2020

It look like this is related to the PSES issue: PowerShell/PowerShellEditorServices#840

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jul 28, 2020
@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Jul 28, 2020
@TylerLeonhardt
Copy link
Member

I'll mark this as a duplicate to the PSES issue since that has some more information on how we could fix this.

@TylerLeonhardt TylerLeonhardt added the Resolution-Duplicate Will close automatically. label Aug 27, 2020
@ghost
Copy link

ghost commented Aug 28, 2020

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

@ghost ghost closed this as completed Aug 28, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extension Terminal Issue-Bug A bug to squash. Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

4 participants