[PR #13261] Accept color name "magenta" instead of "purple" #29452

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

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

State: closed
Merged: Yes


When loading color schemes from Json, check if GetValueForKey failed. If
it did, and we were searching for the colors "purple"/"brightPurple",
swap out the color name with "magenta"/"brightMagenta" and try again.
This was tested manually by creating a new color scheme using the colors
"magenta"/"brightMagenta" and loading it, then printing colored text in
the terminal to assure that the colors were correctly assigned as
purple.

This changes the color loader to use an index pair table to add support
for alternate color names.

Validation Steps Performed

  • Manually edit settings.json, creating a new color scheme with colors
    "magenta" and "brightMagenta"
  • View the color scheme in settings - the colors will appear as "purple"
    and "brightPurple" in the UI
  • Run a program that prints colored text, purple and brightPurple text
    will appear in the colors defined as magenta and brightMagenta
  • Modify the color scheme in the settings UI and save it, the colors
    will be saved as "purple" and "brightPurple" (I think this is the
    right behavior, since calling them "magenta" is technically a
    mistake)
  • Repeat the steps above with a normal color scheme - colors named
    "purple" and "brightPurple" still load properly

Closes #11456

**Original Pull Request:** https://github.com/microsoft/terminal/pull/13261 **State:** closed **Merged:** Yes --- When loading color schemes from Json, check if GetValueForKey failed. If it did, and we were searching for the colors "purple"/"brightPurple", swap out the color name with "magenta"/"brightMagenta" and try again. This was tested manually by creating a new color scheme using the colors "magenta"/"brightMagenta" and loading it, then printing colored text in the terminal to assure that the colors were correctly assigned as purple. This changes the color loader to use an index pair table to add support for alternate color names. ## Validation Steps Performed - Manually edit settings.json, creating a new color scheme with colors "magenta" and "brightMagenta" - View the color scheme in settings - the colors will appear as "purple" and "brightPurple" in the UI - Run a program that prints colored text, purple and brightPurple text will appear in the colors defined as magenta and brightMagenta - Modify the color scheme in the settings UI and save it, the colors will be saved as "purple" and "brightPurple" *(I think this is the right behavior, since calling them "magenta" is technically a mistake)* - Repeat the steps above with a normal color scheme - colors named "purple" and "brightPurple" still load properly Closes #11456
claunia added the pull-request label 2026-01-31 09:34:59 +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#29452