Support random color scheme selection#20114
Open
RAGHAV-0202 wants to merge 1 commit intomicrosoft:mainfrom
Open
Support random color scheme selection#20114RAGHAV-0202 wants to merge 1 commit intomicrosoft:mainfrom
RAGHAV-0202 wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Introduce a special "_random" keyword for the colorScheme setting. When colorScheme is set to "_random" in settings.json, a randomly chosen color scheme from the available schemes is applied each time a new tab or pane is created. Changes: - CascadiaSettings.cpp: Skip validation for the "_random" token in _validateAllSchemesExist() so it doesn't trigger an UnknownColorScheme warning. - TerminalSettings.cpp: Resolve "_random" to a randomly selected scheme at runtime in _ApplyAppearanceSettings(). Usage in settings.json: "colorScheme": "_random" Closes microsoft#9422
Author
|
@microsoft-github-policy-service agree |
Author
|
Hi @zadjii-msft, this PR implements the Would really appreciate your feedback when you get time. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #9422
Introduces a special
_randomkeyword for thecolorSchemesetting. WhencolorSchemeis set to"_random"insettings.json, a randomly chosen color scheme from the available schemes is applied each time a new tab or pane is created.This is inspired by Oh-My-Zsh's random theme feature, as suggested in the original issue.
Usage
In
settings.json, set:Each new tab will now open with a randomly selected color scheme.
Changes
CascadiaSettings.cppRandomSchemeTokenconstant (L"_random")_validateAllSchemesExist()to skip validation when the scheme name is_random, preventing theUnknownColorSchemewarning that blocked the previous attempt at this featureTerminalSettings.cpp_ApplyAppearanceSettings()to detect the_randomtoken and resolve it to a randomly selected scheme from the available color schemes mapstd::random_device+std::mt19937for proper random selectionDesign Decisions
_random(with underscore prefix) as the token per @zadjii-msft's suggestion that it should be "something slightly more obscure than justrandom"_randomtoken independentlyTesting
"colorScheme": "_random", open multiple tabs, verify each gets a different random scheme and no warnings appear.