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 support for changing the active color scheme with an action #6993

Merged
9 commits merged into from
Aug 10, 2020

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

Adds the setColorScheme action, to change the color scheme of the active control to one given by the name parameter. name is required. If name is not the name of a color scheme, the action does nothing.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

Technically, the action is being done by changing the settings of the current TerminalSettings of the TermControl. Frankly, it should be operating on a copy of the TermControl's IControlSettings, then updating the control's settings, or the Control should just listen for changes to it's setting's properties, and update in real time (without a manual call to UpdateSettings. However, both those paths are somewhere unknowable beyond #6904, so we'll just do this for now.

Validation Steps Performed

  • tested manually with a scheme that exists
  • tested manually with a scheme that doesn't exist

@ghost ghost added Area-Settings Issues related to settings and customizability, for console or terminal Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Jul 21, 2020
…etColorScheme

# Conflicts:
#	src/cascadia/TerminalApp/ColorScheme.h
src/cascadia/TerminalApp/AppActionHandlers.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/ColorScheme.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/ColorScheme.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Profile.cpp Outdated Show resolved Hide resolved
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.

  • Update docs
  • What happens when the user misspells the scheme name?
    • Right now, it looks like you go all the way down to CascadiaSettings::ApplyColorScheme and just don't apply the scheme.
    • (Option 1) Should we have some sort of validation/warning? Then we prevent adding a dead keybinding. (this is my preferred route)
    • (Option 2) Should we mark this keybinding as un-handled, and pass the key event straight to the terminal? (this might be a fine way to handle it if option 1 is too much work? But I still think we should do option 1)

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 7, 2020
@zadjii-msft
Copy link
Member Author

  • What happens when the user misspells the scheme name?
    • Right now, it looks like you go all the way down to CascadiaSettings::ApplyColorScheme and just don't apply the scheme.
    • (Option 1) Should we have some sort of validation/warning? Then we prevent adding a dead keybinding. (this is my preferred route)
    • (Option 2) Should we mark this keybinding as un-handled, and pass the key event straight to the terminal? (this might be a fine way to handle it if option 1 is too much work? But I still think we should do option 1)

I don't think the validation code can really handle that right now - I'll file a follow up for now.

I will do the "don't mark it as handled" thing now.

@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 7, 2020
@zadjii-msft
Copy link
Member Author

…etColorScheme

# Conflicts:
#	src/cascadia/TerminalApp/ActionAndArgs.cpp
#	src/cascadia/TerminalControl/TermControl.cpp
@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Aug 10, 2020
@ghost
Copy link

ghost commented Aug 10, 2020

Hello @zadjii-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.

@ghost ghost merged commit aee803e into master Aug 10, 2020
@ghost ghost deleted the dev/migrie/f/5401-setColorScheme branch August 10, 2020 16:22
@ghost
Copy link

ghost commented Aug 26, 2020

🎉Windows Terminal Preview v1.3.2382.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 Area-User Interface Issues pertaining to the user interface of the Console or Terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a shortcut action for switching to a specific color scheme
4 participants