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
$Host.PrivateData colors are completely broken in PowerShell 7.2 #16441
Comments
/cc @SteveL-MSFT |
$Host.PrivateData works if there is no virtual terminal or it is disabled. |
If I change |
Hm. Error output obeys Meanwhile, the |
So WITH NO NOTICE a bunch of code was broken that customized error and verbose output colors, and there is now no way to customize them in a compatible fashion, except to feature-sniff for types/versions and do it both ways. I raised this MONTHS AGO as a REGRESSION BUG and I feel like it was completely brushed off and basically ignored. What is going on with prioritization of development over there?!? |
@dwtaber Error for classic view was a bug that was fixed via #17705 @Jaykul the WGs are working through issues, but haven't gotten to this one. I would propose to have a new |
This did not (and does not) need to be one or the other. The new thing could have been implemented on top of the old. If you implement it as automatic switching, you risk total confusion, when all the colors change when someone meant to change only one... Perhaps the more helpful thing would be to use the new So if something runs: Or if they run Although right now, I'm not sure if the current formatting supports setting background colors. It seems broken to me. |
@Jaykul that is also an option. The only problem is if then the user updates |
Actually, there's a problem with your proposal. |
I think going one way would probably be good enough. I mean, I have code for converting from 16bit colors to 16 colors. |
So what you're saying is that the HOST is still trying to set the colors, but the engine is injecting escape sequences into the text that override the host's settings? |
PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs Lines 1395 to 1402 in edac193
[Console] APIs that accept [ConsoleColor] and overrides the color codes in the string (the string value still contains them).
So in the end, it's up to the host to decide what to do. This was an unfortunate design choice early on. |
So, bottom line: you added a new, non-host way of injecting virtual terminal escape sequences for the same purposes that already existed in the host, and then changed the default host so that if it thinks it's running in a terminal that supports escape sequences ... it just ignores it's own settings. Is that right? Is backward compatibility just out the window forever? |
I've proposed a solution due to the limitations of the existing design. You had a different proposal which seemed good at first until I looked into it and it's not feasible. If you have an alternate proposal, let's discuss it. |
I'm frustrated, but I don't know how I didn't understand that you'd deliberately deprecated PrivateData. Honestly, I don't think there's any point in putting a switch in. It would basically be the same as setting Writing a warning that they're deprecated when someone sets those properties (in a host that |
This comment was marked as off-topic.
This comment was marked as off-topic.
The Interactive WG has reviewed this long standing issue. We don't think that PrivateData can be linked well to PSStyle to remove a poor affect from PrivateData. We think the current behavior of PSStyle was the intended design change, however we want to review this committee before closing this issue. |
Thank you to all that commented on this issue. The PowerShell committee has reviewed and concurs with the Interactive WG that this feature is by designed. We will investigate in the future to emit a depreciation warning if any private data is changed. |
This issue has not had any activity in 6 months, if there is no further activity in 7 days, the issue will be closed automatically. Activity in this case refers only to comments on the issue. If the issue is closed and you are the author, you can re-open the issue using the button below. Please add more information to be considered during retriage. If you are not the author but the issue is impacting you after it has been closed, please submit a new issue with updated details and a link to this issue and the original. |
Prerequisites
Steps to reproduce
$PSStyle
has completely broken the PrivateData colors. Setting them no longer changes anything.Expected behavior
The colors on `$Host.PrivateData` should affect the output
Actual behavior
Changes to `$Host.PrivateData` don't do anything anymore
Error details
No response
Environment data
Visuals
This is what I expected:
The text was updated successfully, but these errors were encountered: