-
Notifications
You must be signed in to change notification settings - Fork 8.1k
RecommendedAction: Explicitly start and stop ANSI Error Color #24065
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
RecommendedAction: Explicitly start and stop ANSI Error Color #24065
Conversation
|
@theJasonHelmick can you have the interactive WG review? It may make sense not to use the error color as the recommendation isn't part of the error |
Will review this week on Wednesday :) |
|
I feel that a recomendation is akin to something that potentially should be passed into to the Informational Stream, so should not take on the colour from the error stream, even though it is a property of the error record. Plus as it is, to me this is more likely to stand out and be acted on than lost in the noise of the rest of the error (especially if there are many of them in a session and for a long time most errors will not have recommended actions) However, it took too long to try test this out with preview.3 not yet in the MSStore & the latest daily is well outdated as the process for releasing the daily build is currently still broken but by downloading the ZIP of preview.3 I could get to works like in the first image, which to me is how I would like this to be in future, and could be a potential $PSStyle addition if you wanted to change that colour to something else instead but that's not really a discussion for this PR but jotting it down for the I-UX WG to comment on further |
| if (-not [String]::IsNullOrWhiteSpace($recommendedAction)) { | ||
| $recommendedAction = $newline + ' Recommendation: ' + $recommendedAction | ||
| $recommendedAction = $newline + | ||
| ${errorColor} + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion in line with my other comment is that instead of ${errorColor} this could be ${recommendationColor} to allow for differing colours to be used instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kilasuit adding a PSStyle option was discussed in the original PR, there's actually a lot that goes into adding that vs. keeping this a small simple PR, I can't commit I could get all of that done by 7.5 but I structured it such that it could be added in the future.
For now I still think it should be formatted with ErrorColor because it is a related property, and gives the user the ability to still customize with PSStyle (as per the original PR implementation and justification), the current behavior is a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WG Interactive group has reviewed this. We agree to implement as this pr describes using ErrorColor. We would recommend making this customizable in the future based on Recommended Action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, all makes sense to me!
7.5-preview.3 has been in the MSStore https://www.microsoft.com/store/apps/9P95ZZKTNRN4. Are you not seeing the preview.3 version in your region?
|
SteveL-MSFT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the WG approved this design change, the code change LGTM
Just to clarify for @andyleejordan this isn't a design change, rather a bugfix to realize the original design intent in #20826 EDIT: Specifically #20826 (comment) |
|
📣 Hey @JustinGrote, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
|
Thanks @JustinGrote! |
CC @SteveL-MSFT please merge before 7.5 GA. Thanks.
PR Summary
Fixes a bug in #20826 where the recommended action does not get colorized in certain circumstances where the ANSI reset code is presented prior to the RecommendedAction test.
Before
After
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.- [ ] Issue filed:
(which runs in a different PS Host).