[PR #8388] Bind Profile Color Schemes #27184

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

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

State: closed
Merged: Yes


Summary of the Pull Request

Binds Profile.ColorScheme to the list of Color Schemes available in the Settings UI.

References

#1564 - Settings UI

Detailed Description of the Pull Request / Additional comments

To my knowledge, there is no way to bind an IMapView to ItemsSource. ItemsSource requires an IObservableVector, so we need to manually populate ColorSchemeList when we navigate to the page.

CurrentColorScheme operates mostly like a standard getter/setter, except it needs to account for the upcoming scenario when a color scheme is renamed or deleted. For now, we fallback to Campbell if the scheme was not found. I would like to make it update automatically, but I feel that we have two approaches here:

  1. TSM stores Profile.ColorScheme as a ColorScheme instead of only the name
  2. When a color scheme name is modified in SUI, we iterate through all of the profiles and modify Profile.ColorScheme accordingly
    Open to discuss these options or any other approaches.

Validation Steps Performed

selected item initialized correctly
list initialized correctly
selecting a new color scheme, then creating a new terminal from that profile uses the new color scheme
setting the color scheme name to a color scheme that does not exist selects "Campbell"

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8388 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Binds `Profile.ColorScheme` to the list of Color Schemes available in the Settings UI. ## References #1564 - Settings UI ## Detailed Description of the Pull Request / Additional comments To my knowledge, there is no way to bind an `IMapView` to `ItemsSource`. `ItemsSource` requires an `IObservableVector`, so we need to manually populate `ColorSchemeList` when we navigate to the page. `CurrentColorScheme` operates mostly like a standard getter/setter, except it needs to account for the upcoming scenario when a color scheme is renamed or deleted. For now, we fallback to Campbell if the scheme was not found. I would like to make it update automatically, but I feel that we have two approaches here: 1. TSM stores `Profile.ColorScheme` as a `ColorScheme` instead of only the name 2. When a color scheme name is modified in SUI, we iterate through all of the profiles and modify `Profile.ColorScheme` accordingly Open to discuss these options or any other approaches. ## Validation Steps Performed ✅ selected item initialized correctly ✅ list initialized correctly ✅ selecting a new color scheme, then creating a new terminal from that profile uses the new color scheme ✅ setting the color scheme name to a color scheme that does not exist selects "Campbell"
claunia added the pull-request label 2026-01-31 09:20:30 +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#27184