-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Comments
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: See how the foregroundcolor reverts to an initial or default background color, and potentially because they are writing 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: 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. |
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: |
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. |
Thank you so much for the reply and information. Yes it works fine once you 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! |
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
orRawUI
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.
The text was updated successfully, but these errors were encountered: