Renaming a color scheme used by a profile should properly update the profile #12032

Open
opened 2026-01-31 03:04:29 +00:00 by claunia · 0 comments
Owner

Originally created by @carlos-zamora on GitHub (Jan 12, 2021).

Originally assigned to: @carlos-zamora on GitHub.

Steps to reproduce

  1. Open Settings UI
  2. Have a profile ("Profile A") refer to a custom color scheme ("Color Scheme A")
  3. Go to the Color Schemes page
  4. Select "Color Scheme A"
  5. Rename it to something else ("Color Scheme B")
  6. Navigate back to the profile that referred to this color scheme ("Profile A")

Expected behavior

"Profile A" should now reference "Color Scheme B".

Actual behavior

"Profile A" refers to "Campbell"

Additional details

The TerminalSettingsModel stores Profile.ColorScheme as a string reference to the name of the ColorScheme.
In TerminalSettingsEditor (Profiles.cpp), if a ColorScheme with that name isn't found, we fallback to "Campbell".

Perhaps a better architecture would be to reference a ColorScheme object in the TerminalSettingsModel? Or at least reference a ColorScheme object in the ViewModel in TerminalSettingsEditor.

Originally created by @carlos-zamora on GitHub (Jan 12, 2021). Originally assigned to: @carlos-zamora on GitHub. # Steps to reproduce 1. Open Settings UI 2. Have a profile ("Profile A") refer to a custom color scheme ("Color Scheme A") 3. Go to the Color Schemes page 4. Select "Color Scheme A" 5. Rename it to something else ("Color Scheme B") 6. Navigate back to the profile that referred to this color scheme ("Profile A") # Expected behavior "Profile A" should now reference "Color Scheme B". # Actual behavior "Profile A" refers to "Campbell" # Additional details The TerminalSettingsModel stores Profile.ColorScheme as a string reference to the name of the ColorScheme. In TerminalSettingsEditor ([Profiles.cpp](https://github.com/microsoft/terminal/blob/7235996b4d83b340a9cfa7227381922e5ad7baf8/src/cascadia/TerminalSettingsEditor/Profiles.cpp#L130)), if a ColorScheme with that name isn't found, we fallback to "Campbell". Perhaps a better architecture would be to reference a `ColorScheme` object in the TerminalSettingsModel? Or at least reference a `ColorScheme` object in the ViewModel in TerminalSettingsEditor.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12032