[PR #9794] [MERGED] Enable previewing the color scheme in the command palette #27750

Open
opened 2026-01-31 09:24:00 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9794
Author: @zadjii-msft
Created: 4/13/2021
Status: Merged
Merged: 4/21/2021
Merged by: @undefined

Base: mainHead: dev/migrie/preview-setcolorscheme


📝 Commits (10+)

  • c6432b6 add object on Core side
  • f806011 object in settings model side
  • 5aa1e66 applib side object
  • c423e11 barebones prototype
  • 8f8e6e7 renaming
  • f4dd69a cursor shape
  • 235bbd7 background image works now
  • dc8328d deduplicate code: UpdateSettings now calls UpdateAppearance
  • d3ad801 spell, Cl check
  • 43c6204 IAppearanceConfig interface in settings model side, color scheme gets applied fully

📊 Changes

14 files changed (+614 additions, -13 deletions)

View changed files

📝 src/cascadia/LocalTests_TerminalApp/TabTests.cpp (+330 -0)
src/cascadia/TerminalApp/ActionPreviewHandlers.cpp (+189 -0)
📝 src/cascadia/TerminalApp/AppActionHandlers.cpp (+20 -1)
📝 src/cascadia/TerminalApp/CommandPalette.cpp (+11 -2)
📝 src/cascadia/TerminalApp/CommandPalette.h (+1 -0)
📝 src/cascadia/TerminalApp/CommandPalette.idl (+1 -0)
📝 src/cascadia/TerminalApp/TerminalAppLib.vcxproj (+5 -1)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+2 -0)
📝 src/cascadia/TerminalApp/TerminalPage.h (+7 -0)
📝 src/cascadia/TerminalSettingsModel/ActionArgs.h (+3 -0)
📝 src/cascadia/TerminalSettingsModel/ActionArgs.idl (+1 -0)
📝 src/cascadia/TerminalSettingsModel/TerminalSettings.cpp (+34 -9)
📝 src/cascadia/TerminalSettingsModel/TerminalSettings.h (+8 -0)
📝 src/cascadia/TerminalSettingsModel/TerminalSettings.idl (+2 -0)

📄 Description

Summary of the Pull Request

Allow schemes to be previewed as the user hovers over them in the Command Palette.

preview-set-color-scheme

References

  • Branched off of #8392, which is why the commit history is so polluted. 330a8e8 : 544b2fd has the interesting commits
  • #5400: cmdpal megathread

Potential follow-ups

  • changing the font size
  • changing the font face
  • changing the opacity of acrylic

PR Checklist

  • Closes #6689, a last straggling FHL PR
  • I work here
  • Tests added/passed
  • [n/a] Requires documentation to be updated - I don't think so

Detailed Description of the Pull Request / Additional comments

This works by inserting a "preview" TerminalSettings into the settings hierarchy, before the TermControl's runtime settings, and after the ones from the actual CascadiaSettings. This allows us to modify that preview settings object, then discard it when we're done with the preview.

This could also be used for other settings in the future - I built it to be extensible to other ShortcutActions, though I haven't implemented those yet.

Validation Steps Performed

  • Select a colorscheme - it becomes the active one
  • colortool -x <scheme> after selecting a scheme - colortool overrides the selected scheme
  • Select a colorscheme after a colortool -x <scheme> after selecting a scheme - the scheme in the palette becomes the active one
  • Pressing esc at any point to dismiss the command palette - scheme returns to the previous one
  • reloading the settings - returns to the scheme in the settings

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/9794 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 4/13/2021 **Status:** ✅ Merged **Merged:** 4/21/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/preview-setcolorscheme` --- ### 📝 Commits (10+) - [`c6432b6`](https://github.com/microsoft/terminal/commit/c6432b6a733cec7728b073ce992f74e0283d76fc) add object on Core side - [`f806011`](https://github.com/microsoft/terminal/commit/f806011dc2c2c504348886cf0d9a0bfb1383be9c) object in settings model side - [`5aa1e66`](https://github.com/microsoft/terminal/commit/5aa1e66fb8cabff36d043d371eb36d6a9ce2548f) applib side object - [`c423e11`](https://github.com/microsoft/terminal/commit/c423e11394486ae85f39d127067357450a03d03a) barebones prototype - [`8f8e6e7`](https://github.com/microsoft/terminal/commit/8f8e6e7b25f87177880f52dc2f5a2a2d9c6dc395) renaming - [`f4dd69a`](https://github.com/microsoft/terminal/commit/f4dd69aaac8151434936301ac8d0d39675bdd07f) cursor shape - [`235bbd7`](https://github.com/microsoft/terminal/commit/235bbd725e6605d150842614d8167596f569e060) background image works now - [`dc8328d`](https://github.com/microsoft/terminal/commit/dc8328dde6a0f1ce97d9f9cba355858808ad93dd) deduplicate code: UpdateSettings now calls UpdateAppearance - [`d3ad801`](https://github.com/microsoft/terminal/commit/d3ad80120cb83acaceaa4ea8db8fdc12cd3e0237) spell, Cl check - [`43c6204`](https://github.com/microsoft/terminal/commit/43c620443f2c46678e7fd935919282b03d93c759) IAppearanceConfig interface in settings model side, color scheme gets applied fully ### 📊 Changes **14 files changed** (+614 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/LocalTests_TerminalApp/TabTests.cpp` (+330 -0) ➕ `src/cascadia/TerminalApp/ActionPreviewHandlers.cpp` (+189 -0) 📝 `src/cascadia/TerminalApp/AppActionHandlers.cpp` (+20 -1) 📝 `src/cascadia/TerminalApp/CommandPalette.cpp` (+11 -2) 📝 `src/cascadia/TerminalApp/CommandPalette.h` (+1 -0) 📝 `src/cascadia/TerminalApp/CommandPalette.idl` (+1 -0) 📝 `src/cascadia/TerminalApp/TerminalAppLib.vcxproj` (+5 -1) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+2 -0) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+7 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionArgs.h` (+3 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionArgs.idl` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettings.cpp` (+34 -9) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettings.h` (+8 -0) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettings.idl` (+2 -0) </details> ### 📄 Description ## Summary of the Pull Request Allow schemes to be previewed as the user hovers over them in the Command Palette. ![preview-set-color-scheme](https://user-images.githubusercontent.com/18356694/114557761-9a3cbd80-9c2f-11eb-987f-eb0c89ee1fa6.gif) ## References * Branched off of #8392, which is why the commit history is so polluted. 330a8e8 : 544b2fd has the interesting commits * #5400: cmdpal megathread ### Potential follow-ups * changing the font size * changing the font face * changing the opacity of acrylic ## PR Checklist * [x] Closes #6689, a last straggling FHL PR * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated - I don't think so ## Detailed Description of the Pull Request / Additional comments This works by inserting a "preview" `TerminalSettings` into the settings hierarchy, before the `TermControl`'s runtime settings, and after the ones from the actual `CascadiaSettings`. This allows us to modify that preview settings object, then discard it when we're done with the preview. This could also be used for other settings in the future - I built it to be extensible to other `ShortcutAction`s, though I haven't implemented those yet. ## Validation Steps Performed * Select a colorscheme - it becomes the active one * `colortool -x <scheme>` after selecting a scheme - colortool overrides the selected scheme * Select a colorscheme after a `colortool -x <scheme>` after selecting a scheme - the scheme in the palette becomes the active one * Pressing <kbd>esc</kbd> at any point to dismiss the command palette - scheme returns to the previous one * reloading the settings - returns to the scheme in the settings --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:24:00 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27750