Skip to content

Powershell Integrated Console colors wrong #792

@ChristopherGLewis

Description

@ChristopherGLewis

The Powershell IC doesn't display certain background and foreground colors the same as the ISE and CMD.Exe shell.

Main issue is a Background color of BLACK shows up as white, GRAY shows up as dark gray, DARK GRAY shows up as gray, and WHITE shows up as a third gray.

Also, when foreground and background are the same color, the IC defaults to white on white.

Simple script to test

$FGcolors = [enum]::GetValues([System.ConsoleColor])
$BGcolors = [enum]::GetValues([System.ConsoleColor])
$size = 10 

Write-Host "".PadRight($Size).Substring(0,$size) -NoNewline
Foreach ($BGcolor in $BGcolors) {
    Write-Host $BGcolor.ToString().PadRight($Size).Substring(0,$size)  -BackgroundColor $BGcolor -NoNewline
}
Write-Host 
Foreach ($FGcolor in $FGcolors) {
    Write-Host  $FGColor.ToString().PadRight($Size).Substring(0,$size) -foreground $FGColor -NoNewline

    Foreach ($BGcolor in $BGcolors)
    {
         Write-Host   $FGColor.ToString().PadRight($Size).Substring(0,$size) -background $BGColor -foreground $FGColor -nonewline
    }
    Write-Host 
}

Powershell IC
image

Powershell ISE
image

CMD.EXE running Powershell
image

System Details

  • Operating system name and version: Win 7
  • VS Code version: 1.12.2
  • PowerShell extension version: 1.1.0
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.14409.1005
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1005
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

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