Steps to reproduce
# create an object with string fields that are ANSI-colored
$esc = [char]27
function red($s) { "$esc[31m$s$esc[0m" }
function white($s){ "$esc[37m$s$esc[0m" }
function blue($s) { "$esc[36m$s$esc[0m" }
$o = [pscustomobject]@{
Field1 = (red "This is red")
Field2 = (white "This is white")
Field3 = (blue "This is blue")
}
$o | Format-Table
Expected behavior
Output is both colored and correctly aligned. This is the case on Windows 10 with both Windows Powershell 5.1 and Powershell Core 6.0 Alpha 11.

Actual behavior
On Mac, output is colored, but table headings are misaligned.

I believe the issue is that column width is being calculated based on raw string length, not considering that some characters don't contribute to the "display length".
Environment data
OSX El Capitan 10.11.6
Name Value
---- -----
PSVersion 6.0.0-alpha
PSEdition Core
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 3.0.0.0
GitCommitId v6.0.0-alpha.11
CLRVersion
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Steps to reproduce
Expected behavior
Output is both colored and correctly aligned. This is the case on Windows 10 with both Windows Powershell 5.1 and Powershell Core 6.0 Alpha 11.
Actual behavior
On Mac, output is colored, but table headings are misaligned.
I believe the issue is that column width is being calculated based on raw string length, not considering that some characters don't contribute to the "display length".
Environment data
OSX El Capitan 10.11.6