Support random color scheme selection#20114
Support random color scheme selection#20114RAGHAV-0202 wants to merge 2 commits 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
|
@microsoft-github-policy-service agree |
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.Unrecognized words (780)These words are not needed and should be removedAPCs bitmasks changelists clsids Cmts codepages COLORREFs colorschemes distros DPIs DWORDs flyouts frontends Fullscreens Ioctl keydowns keyups lto noexcepts nullopts OEMs pdbs popups reparented rgbs scancodes screenshots subkeys testenvs titlebars Tlgg toolbars UChars UINTs unittests wchars websites wstrings xamls ZWJsSome files were automatically ignored 🙈These sample patterns would exclude them: You should consider adding them to: File matching is via Perl regular expressions. To check these files, more of their words need to be in the dictionary than not. You can use To accept these unrecognized words as correct, update file exclusions, and remove the previously acknowledged and now absent words, you could run the following commands... in a clone of the git@github.com:RAGHAV-0202/terminal.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/25002849484/attempts/1' &&
git commit -m 'Update check-spelling metadata'Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionaryThis includes both expected items (2082) from .github/actions/spelling/expect/74d92373e136649071b3c04dc8773f18deaf5e04.txt .github/actions/spelling/expect/alphabet.txt .github/actions/spelling/expect/expect.txt .github/actions/spelling/expect/web.txt and unrecognized words (780)
Consider adding to the "cspell:software-terms/dict/softwareTerms.txt",
"cspell:cpp/src/stdlib-cpp.txt",
"cspell:cpp/src/stdlib-c.txt",
"cspell:python/src/python/python-lib.txt",
"cspell:node/dict/node.txt",
To stop checking additional dictionaries, put (in the "check_extra_dictionaries": []Pattern suggestions ✂️ (5)You could add these patterns to Alternatively, if a pattern suggestion doesn't make sense for this project, add a Errors, Warnings, and Notices ❌ (5)See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.
See ❌ Event descriptions for more information. ✏️ Contributor please read thisBy default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later. If the listed items are:
See the 🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉 If the flagged items are 🤯 false positivesIf items relate to a ...
|
We trigger CI, you do not ;) |
Got it , thanks. I thought checks were automatic. |
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.