-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Make property names for the color VT sequences consistent with documentations #16212
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
Conversation
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.
Looks good to me and could not spot a mistake. Due to the property names being public, it is breaking a change as already indicated but I don't think real software depends on it, I imagine only custom user setup. In theory we could leave the old property names and point them to the new ones and send telemetry.
|
Makes sense to me, since it is still preview and anyone working at this level is going to be used to these VT level color sequences, the consistency is appropriate. |
|
The |
|
@rkeithhill it was added in 7.2, we made it stable in preview.10 (or 9?). My opinion is to either change it now or never. I'm leaving it to the WG to make a formal decision :) |
|
I will need to reorder the properties, will push another commit soon. |
|
Better do it now then IMO. |
|
The names were originally copied from the "command-line-api" repo from So we should fix in PowerShell as well, before 7.2 GA. |
src/System.Management.Automation/FormatAndOutput/common/PSStyle.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/FormatAndOutput/common/PSStyle.cs
Outdated
Show resolved
Hide resolved
|
🎉 Handy links: |
|
🎉 Handy links: |
PR Summary
We use the property names 'Light***' such as
LightRedandLightGreenfor VT sequences that are documented as "Bright Foreground <color>" and "Bright Background <color>", such as 'Bright Red' and 'Bright Green'. This is misleading, we should make the property names consistent with those in the documentation, so it's more intuitive for users to work with VT color in PowerShell.PowerShell/src/System.Management.Automation/FormatAndOutput/common/PSStyle.cs
Lines 78 to 88 in e98a8c8
More Context
The names were originally copied from the "command-line-api" repo from
System.CommandLine.Rendering.Color+ForegroundandSystem.CommandLine.Rendering.Color+Background. Now it's been confirmed that those properties were misnamed in that repo and will be fixed there, see dotnet/command-line-api#1438.So we should fix in PowerShell as well, before 7.2 GA.
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.