Skip to content
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

Add cursorColor to color scheme #4651

Merged
7 commits merged into from
Mar 17, 2020
Merged

Add cursorColor to color scheme #4651

7 commits merged into from
Mar 17, 2020

Conversation

yitzhaks
Copy link
Contributor

@yitzhaks yitzhaks commented Feb 20, 2020

Add the option to set the cursor color as part of the color scheme.

This is very useful for light themes, where the cursor disappears unless its color
is set in the profile.

Related to issue #764, but doesn't fully resolve it.

Validation

I tested this manually by creating a light color scheme, setting the cursor color
to black and setting the profile color scheme to the newly created color scheme.
I validated the cursor is black, then set the cursor color in the profile (to red)
and saw it trumps the cursor color from the color scheme.

Add the option to set the cursor color as part of the color scheme.
This is very useful for light themes, where the cursor disappears unless
its color is set in the profile.
@yitzhaks
Copy link
Contributor Author

While locally validating, I didn't see my changes to the built-in color schemes reflected. Is this expected?

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof fat-fingered ctrl+enter

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I'd love some extra tests to check scenarios like:

  1. a scheme doesn't have a cursorColor set
  2. A profile doesn't have a cursorColor but it's scheme does
  3. A profile doesn't have a cursorColor and neither does it's scheme
  4. A profile does have a cursorColor but it's scheme doesn't

But I'm still happy with this without those extra tests 😄

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Yeah, I wanna see the tests above too please.
  2. I want to double check something. This doesn't make cursorColor required for a colorScheme right? Like, when this goes in, existing users that have custom colorSchemes without cursorColor will be unaffected by this change?
  3. Could you please update doc/cascadia/SettingsSchema.md too?

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Feb 20, 2020
@carlos-zamora
Copy link
Member

@DHowett-MSFT Also, the discussion on #764 sounds like cursorColor could/should be added to color schemes, but the others (i.e.: cursorShape, fontFace, and fontSize) should not. I agree with that reasoning. Should we just close that issue once this PR goes in?

@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Feb 22, 2020
Add a test that checks the resulting cursor color for all combinations
of setting cursor color or not setting it in profile and color scheme,
and for not setting a color scheme at all.
@yitzhaks
Copy link
Contributor Author

I added the tests @zadjii-msft suggested (and a tiny bit more).
@carlos-zamora, regarding existing users, they shouldn't be negatively impacted by this change.
If they didn't set a cursorColor in their profile they'll:

  1. If they didn't set a colorScheme, they'll get #FFFFFF (from the default built-in color scheme).
  2. If they set a built-in colorScheme, they'll get the cursor color from that color scheme. This is the only case users should see any changes, and only for the good (in the case of light color schemes where the cursor was invisible they'll now see their cursor, which is what spurred the discussion in the first place).
  3. If they set a custom colorScheme, they'll get DEFAULT_CURSOR_COLOR == #FFFFFF (as the default for cursorColor when it's not set in their color scheme).

If they set a cursorColor in their profile, it will trump any cursorColor in the color scheme.
All these cases are covered by the tests I added, so I think we're good here.

Yitzhak Steinmetz added 2 commits February 23, 2020 00:59
There is no default cursor color for profile, and the documentation
shouldn't say there is. The default cursor color is only relevant for
color schemes (where it's correctly documented).
Align json and md on "of the" (instead of "for the").
@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. Needs-Second It's a PR that needs another sign-off labels Feb 24, 2020
@ghost ghost requested review from miniksa and leonMSFT February 24, 2020 14:38
Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this. Really sorry we took so long to review it. Thanks for the work!

Happy to merge after conflict resolution.

@DHowett-MSFT
Copy link
Contributor

And yes, this should just close the referenced issue. Cursor shape shouldn’t be part of a color palette. :)

@zadjii-msft
Copy link
Member

@carlos-zamora You should make another pass on this one, so we can get it merged

@yitzhaks
Copy link
Contributor Author

@DHowett-MSFT, whenever you're ready :)

@DHowett-MSFT DHowett-MSFT added the AutoMerge Marked for automatic merge by the bot when requirements are met label Mar 17, 2020
@ghost
Copy link

ghost commented Mar 17, 2020

Hello @DHowett-MSFT!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@DHowett-MSFT
Copy link
Contributor

Thanks for the contribution!

@ghost ghost merged commit c0d704e into microsoft:master Mar 17, 2020
@yitzhaks yitzhaks deleted the dev/yitzhaks/CursorColorInColorScheme branch March 17, 2020 20:25
@ghost
Copy link

ghost commented Apr 22, 2020

🎉Windows Terminal Preview v0.11.1121.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal AutoMerge Marked for automatic merge by the bot when requirements are met Needs-Second It's a PR that needs another sign-off Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants