Skip to content

Conversation

@daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Oct 8, 2021

PR Summary

We use the property names 'Light***' such as LightRed and LightGreen for 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.

public string LightBlue { get; } = "\x1b[94m";
/// <summary>
/// Gets the color light cyan.
/// </summary>
public string LightCyan { get; } = "\x1b[96m";
/// <summary>
/// Gets the color light gray.
/// </summary>
public string LightGray { get; } = "\x1b[97m";

More Context

The names were originally copied from the "command-line-api" repo from System.CommandLine.Rendering.Color+Foreground and System.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

@SteveL-MSFT SteveL-MSFT added Breaking-Change breaking change that may affect users WG-DevEx-SDK hosting PowerShell as a runtime, PowerShell's APIs, PowerShell Standard, or development of modules labels Oct 8, 2021
Copy link
Contributor

@bergmeister bergmeister left a 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.

@JustinGrote
Copy link
Contributor

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.

@rkeithhill
Copy link
Collaborator

The $PSStyle is only in 7.2 previews, right? I don't see it in my 7.1.x install. So is this really a breaking change? IMO you have the right to change anything in a preview. That's why it's called "preview". Once it hits RC or especially any sort of "go live" designation, then you shouldn't introduce a breaking change unless it meets a very high bar.

@SteveL-MSFT
Copy link
Member

@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 :)

@daxian-dbw
Copy link
Member Author

I will need to reorder the properties, will push another commit soon.

@rkeithhill
Copy link
Collaborator

Better do it now then IMO.

@daxian-dbw
Copy link
Member Author

The names were originally copied from the "command-line-api" repo from System.CommandLine.Rendering.Color+Foreground and System.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.

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 9, 2021
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 9, 2021
@daxian-dbw daxian-dbw added Backport-7.2.x-Consider CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log labels Oct 11, 2021
@ghost
Copy link

ghost commented Oct 21, 2021

🎉v7.2.0-rc.1 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Dec 16, 2021

🎉v7.3.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.2.x-Done Breaking-Change breaking change that may affect users CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log WG-DevEx-SDK hosting PowerShell as a runtime, PowerShell's APIs, PowerShell Standard, or development of modules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants