Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

powershell output color is green after latest windows update #2097

Closed
spooky opened this issue May 15, 2019 · 3 comments
Closed

powershell output color is green after latest windows update #2097

spooky opened this issue May 15, 2019 · 3 comments

Comments

@spooky
Copy link

spooky commented May 15, 2019

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
@spooky
Copy link
Author

spooky commented May 17, 2019

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

@spooky spooky closed this as completed May 17, 2019
@Structed
Copy link

Structed commented Jul 9, 2019

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

@gluons
Copy link

gluons commented Jul 15, 2019

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. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants