Cmder: powershell output color is green after latest windows update

Created on 15 May 2019  ·  3Comments  ·  Source: cmderdev/cmder

Using cmder Version 1.3.11.843 on windows 10 with the latest ui update applied.

After the update, the output of powershell staty green. I've tracked it to profile.ps1 line 104

Microsoft.PowerShell.Utility\Write-Host $pwd.ProviderPath -NoNewLine -ForegroundColor Green

When that Green is removed/changed to white, that solves the problem, but of course changes the pwd color as well.

Also, ctr+l seems to misbehave and cause unwanted scrolling - I don't have the exact steps to reproduce yet though.

Problems weren't there before the update.

EDIT:

λ  $host.UI.RawUI


ForegroundColor       : Green
BackgroundColor       : Black
CursorPosition        : 0,127
WindowPosition        : 0,70
CursorSize            : 25
BufferSize            : 214,1000
WindowSize            : 214,58
MaxWindowSize         : 214,191
MaxPhysicalWindowSize : 214,58
KeyAvailable          : False
WindowTitle           : posh~git

Most helpful comment

Updating PSReadline to latest release (beta4) solved both issues.

All 3 comments

Updating PSReadline to latest release (beta4) solved both issues.

Install-Module -Name PSReadLine -AllowPrerelease
to install the new PsReadline.

You might run into an error:
Install-Module : A parameter cannot be found that matches parameter name 'AllowPrerelease'

To solve this, you need to install the latest version of PowerShellGet:
Install-Module PowershellGet -Force

Update

Actual install process on another machine (Windows 10 1903, Build 18362.239, cmder 180262 preview) was like this:

  • Open cmder
  • Open Administrative PowerShell
  • Execute Install-Module PowershellGet -Force
  • Restart cmder
  • Open Administrative PowerShell
  • Execute Install-Module -Name PSReadLine -AllowPrerelease -Force to install version 2.0.0-beta4 (2.0.0-beta2 was previously installed)
  • Console colors were back to normal

I got error about admin permission. Because PowerShell is running. So it's using PSReadLine and prevent it from being overwritten.

Open cmd as admin and run

powershell -Command "Install-Module -Name PSReadLine -AllowPrerelease -Force"

solve my problem.

Thank you. Upgrading PSReadLine solve my problem. 😊

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jordanrobinson picture jordanrobinson  ·  3Comments

giuliannosbrugnera picture giuliannosbrugnera  ·  3Comments

luisrudge picture luisrudge  ·  3Comments

tfarina picture tfarina  ·  3Comments

vincentntang picture vincentntang  ·  3Comments