question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Powershell Integrated Console colors wrong

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
NemoSteincommented, Nov 9, 2017

I don’t know if this is a related issue, but I’m having some trouble with colors too…

Powershell powershell

VS Code vscode

It may be a problem with Pshazz (it works fine on powershell, though).

3reactions
confusingbitscommented, Dec 13, 2017

I think I may have found a work around for the color formatting issues with the integrate console on windows. I have tried changing or resetting colors of powershell to no avail, but enabling the ‘Use legacy console (requires relaunch)’ checkbox appears to resolve my ongoing issues with an unreadable integrated terminal due to what appears to be improper background colors for text.

To reach the settings, open a powershell, and right click the title window and select properties > options. Enable ‘Use legacy console (requires relaunch)’. (Restarting VScode and/or all open Powershells may be needed. I don’t know.) console fix

After enabling this, my vscode integrated terminal appears work exactly as expected now after months of incorrect formatting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code terminal colors are screwy - Stack Overflow
Depending on your color settings and what is being displayed, this can cause your integrated terminal foreground colors to be wrong.
Read more >
Integrated terminal (PS) colors messed up : r/vscode - Reddit
If I open up a standard powershell terminal, I do not have this problem with the colors. Despite that, I've checked all 6...
Read more >
Change PowerShell console syntax highlighting colors of ...
You can change the PowerShell console colors of the PSReadLine module that Microsoft delivers with PowerShell since version 5.
Read more >
Terminal | IntelliJ IDEA Documentation - JetBrains
IntelliJ IDEA includes an embedded terminal emulator for working with your command-line shell from inside the IDE. Use it to run Java tools, ......
Read more >
Terminal Profiles in Visual Studio Code
Visual Studio Code's integrated terminal allows configuring various profiles to ... shell defaults to $SHELL on Linux and macOS and PowerShell on Windows....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found