-
Notifications
You must be signed in to change notification settings - Fork 127
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 console left with incorrect colors in some situations #32
Comments
Thanks for raising this issue! Does the code listing that you've included above show the only writes to the console that have occurred in your application prior to the time at which you see the unexpected behavior (i.e. the foreground color being set to black)? In other words, is your application only making the 4 color changes (Green, Yellow, Red, Cyan) before the issue occurs, or is it making more color changes that aren't shown in your code listing? I've attempted to reproduce this, and haven't been able to. I have two thoughts:
I can't say much more than that without having a better idea of how you're using Colorful.Console. |
Well my code snippet above is the only thing needed in |
Interesting. May I ask what operating system you're using? |
win 10 1703 15063.413 |
Thanks. I'll spend more time looking into this tomorrow. In the meantime, let me know if you observe anything else that may help us to understand what is going wrong, here. |
One more thought: have you tried a more minimal use-case, e.g.
Maybe only start with one color change, and then increase to two, and so on, until the issue occurs. |
I did, 4 is my actual use case, but 4 seems to be the magic number as well (at least for the above test case). I saw other irregularities when mixing with posh-git and several runs but those were likely due to the 16 color issue eventually kicking in. (Note here posh git is not enabled). |
I ran into a similar issue with the default powershell console.
This set the entire background of the console to yellow until exiting that terminal. |
Hello @tomakita, im writing a logging library and want to use your library to bring some colors to the output and got the same issue with PowerShell.
|
Unfortunately, this is a show-stopper for my use of this library. Is it possible to use VT codes where supported by later versions of Windows 10? |
I have this issue as well. It only appears in the actual No matter how many times you switch between 1-4 colors, upon using a 5th color |
Thanks for all of these reports. I'm guessing that the way in which Colorful.Console writes colors into the console buffer breaks some aspect of the way in which PowerShell depends on the console buffer. I'm not sure if I'll be able to fix this without knowing more about how PowerShell depends on the buffer, and I'm a little too busy to do that right now, but will put this on my to-do list. Regarding VT codes in Win 10, see #24 . There's no support yet, but it's being worked on...very slowly. |
I am experiencing the same issue, when using Windows Terminal with Powershell Core.
Powershell (showing green text when it should be white) Could be related to this: |
Having an issue where sometimes the console colors are getting screwed up. Here is a code sample that shows the point:
What is interesting is that only when the background color is set to black does it screw up (and that is with the background set to black). In addition if you leave the writelinestyled off it doesn't happen.
Standard command shell is fine. Trying to use the app with a powershell script combo so just not using powershell is not an option.
The behavior I see is that the powershell window starts out with background black, foreground white. After running this the foreground color is set to black.
The text was updated successfully, but these errors were encountered: