[PR #8793] Bugfix: sync color scheme rename with profile reference #27297

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

Original Pull Request: https://github.com/microsoft/terminal/pull/8793

State: closed
Merged: Yes


Summary of the Pull Request

This fixes a bug where renaming/deleting a color scheme would not update profiles that referenced it.

This also adds detection for renaming a color scheme to a name that is already in use, and adds appropriate UI for that.

References

#6800 - Settings UI Epic

PR Checklist

Detailed Description of the Pull Request / Additional comments

Model::CascadiaSettings was updated to have a UpdateColorSchemeReferences() function that updates all profiles referencing the newly renamed color scheme.

Editor::ColorSchemesPageNavigationState now takes and exposes a Model::CascadiaSettings.

When a color scheme is renamed or deleted, we use CascadiaSettings to update our list of color schemes appropriately, then call UpdateColorSchemeReferences() to update the profiles.

The tricky part is that Profile does not store a direct reference to ColorScheme, but rather the name of the color scheme. See this tread for a discussion on this topic.

Validation Steps Performed

Repro steps from #8756 when renaming/deleting a referenced color scheme.

Demo

Scheme Name Already In Use Demo

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8793 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This fixes a bug where renaming/deleting a color scheme would not update profiles that referenced it. This also adds detection for renaming a color scheme to a name that is already in use, and adds appropriate UI for that. ## References #6800 - Settings UI Epic ## PR Checklist * [X] Closes #8756 ## Detailed Description of the Pull Request / Additional comments `Model::CascadiaSettings` was updated to have a `UpdateColorSchemeReferences()` function that updates all profiles referencing the newly renamed color scheme. `Editor::ColorSchemesPageNavigationState` now takes and exposes a `Model::CascadiaSettings`. When a color scheme is renamed or deleted, we use `CascadiaSettings` to update our list of color schemes appropriately, then call `UpdateColorSchemeReferences()` to update the profiles. The tricky part is that `Profile` does not store a direct reference to `ColorScheme`, but rather the name of the color scheme. See [this tread](https://github.com/microsoft/terminal/issues/8756#issuecomment-760375027) for a discussion on this topic. ## Validation Steps Performed Repro steps from #8756 when renaming/deleting a referenced color scheme. ## Demo ![Scheme Name Already In Use Demo](https://user-images.githubusercontent.com/11050425/105431427-6e023980-5c0a-11eb-894a-42152fc77f05.gif)
claunia added the pull-request label 2026-01-31 09:21:12 +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#27297