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

RawUI & PrivateData: Console Colors are broken? #372

Closed
JontuKontar opened this issue Feb 13, 2019 · 5 comments
Closed

RawUI & PrivateData: Console Colors are broken? #372

JontuKontar opened this issue Feb 13, 2019 · 5 comments
Labels
Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Question For questions or discussion Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Product-Conhost For issues in the Console codebase

Comments

@JontuKontar
Copy link

When using (Get-Host).PrivateData or (Get-Host).UI.RawUI to set Console Colors, they only exist when the console is opened.

Typed text is not bound to them nor do the properties of PrivateData or RawUI indicate that they are properly set. (Clear-Host, effectively removes all changes from the Console.)

Enabling "Use Legacy Console" restores expected function.

Not sure if there is something else I should be doing to make the color changes stick with the "Modern Console" or if this is a legitimate bug in the way console colors are applied to the Console.

@zadjii-msft
Copy link
Member

zadjii-msft commented Feb 13, 2019 via email

@miniksa miniksa added Product-Conhost For issues in the Console codebase Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. labels Mar 4, 2019
@lawlz
Copy link

lawlz commented Mar 30, 2019

Hey All!

I am having the same issue and I believe it is related to the psreadline v2, which you probably already know, since there are many issues around console coloring, #818, #774, #276 . Here is a reproduction of what I am seeing:

image

See how the foregroundcolor reverts to an initial or default background color, and potentially because they are writing CSI 0 m and not saving or persisting this new console color setting. Comment found here from the main maintainer.

After downloading the latest module from the above repo, it seems to be working, but the versioning is weird. It appears the psreadline module in the repo is still 1.0 and the version that is shipped with windows is installing the 2.0, which appears to be beta... Also, any reference to the 2.0 Beta still seems to tie back to the repo above which has the 1.0 versioning... Here is a reference to 2.0, but the only activity from SteveL, externally facing that is, shows a forked repo of the above PSReadline.

Here it is working from the package downloaded from that repo:

errorRepro

Long story short, I believe this to be a duplicate issue and fixed in a 'new' version of PSReadline, unless the goal is to move away from the 1.0 and go to 2.0. If that is the case, the latest build for 2.0, that I could find, was last updated last September and still a beta and still has this issue. I am not sure, but wanted to update this issue and hopefully get some insider insight on what the direction forward is on this module and maybe why MS would ship a beta version of a module when, on this machine, I don't have developer mode on or anything. Thank you.

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@DHowett-MSFT
Copy link
Contributor

maybe why MS would ship a beta version of a module

If I had to guess, it's because PSReadline 2.0 (even in beta) is so much better than 1.4 that it was worth it in their risk assessment.

Since it looks like this issue was originally caused by PSReadline saving and restoring colors, I'm going to mark this one for garbage collection. If it isn't because PSReadline was saving and restoring colors, please feel free to reopen it.

(A quick check: Remove-Module PSReadline, then do your color test. If they still don't stay, it could be our fault.)

@DHowett-MSFT DHowett-MSFT added Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Question For questions or discussion Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 18, 2019
@ghost ghost added No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. and removed Needs-Tag-Fix Doesn't match tag requirements labels May 18, 2019
@ghost
Copy link

ghost commented May 22, 2019

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost ghost closed this as completed May 25, 2019
@lawlz
Copy link

lawlz commented May 26, 2019

Thank you so much for the reply and information. Yes it works fine once you remove-module psreadline, but of course you lose all that PSReadLine goodness.

As an aside, I pulled down the 2.0.0-Beta4 version that was released to the Gallery 19 days ago and it appears to have the required patch to fix this issue!

Thanks again for your help Dustin!

@ghost ghost removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label May 26, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Question For questions or discussion Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Product-Conhost For issues in the Console codebase
Projects
None yet
Development

No branches or pull requests

5 participants