Skip to content

Format-Table -Wrap produces strange output for a mix of long lines and lines containing tabs #6313

@Arnavion

Description

@Arnavion

Steps to reproduce

Windows 7, with pwsh.exe's window size set to 200x75. The width is the relevant thing. Choice of font does not seem to matter.

Edit: Also repros on openSUSE Tumbleweed in a similarly sized ssh window or konsole window.

@((
	New-Object psobject | Add-Member -Passthru Foo "a`tb"
), (
	New-Object psobject | Add-Member -Passthru Foo ("c`t" + 'd' * 200)
), (
	New-Object psobject | Add-Member -Passthru Foo "e`tf"
)) | Format-Table -Wrap

Expected behavior

image

(from PS 5)

Actual behavior

image

  • There is an extra line after the first and last element (in fact there is an extra line after every row except the one with the wrapping value)

  • The row that has the long value is wrapped strangely.

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.1
PSEdition                      Core
GitCommitId                    v6.0.1
OS                             Microsoft Windows 6.1.7601 S
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

and

Name                           Value
----                           -----
PSVersion                      6.0.1
PSEdition                      Core
GitCommitId                    v6.0.1
OS                             Linux 4.15.6-1-default #1 SMP PREEMPT Sun Feb 25 18:51:57 UTC 2018 (06f0b06)
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Removing the tab character from the first object's property (or even replacing it with 8 spaces) fixes the extra line between the rows but does not fix the strange wrapping of the long row.

Shortening the long row so that it does not need to wrap also fixes the extra line between the rows.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions