[PR #2658] Add support for short hex color codes like #CCC (#2639) #25027

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

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

State: closed
Merged: Yes


Summary of the Pull Request

This adds a few lines to support shorthand color hex codes like #ABC. They are treated as equivalent of #AABBCC

References

N/A

PR Checklist

  • Closes Run As Administrator (#2639)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Doesn't require documentation to be updated as far as I understand
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #2639

Detailed Description of the Pull Request / Additional comments

The PR is only a few lines of code so should be self-explanatory.

Validation Steps Performed

I've changed src/cascadia/ut_app/JsonTests.cpp thanks to the fact that Cascadia actually has a white color that can be expressed this way. The new test passes on my machine.

I thought that change might be a better idea than adding a new test to https://github.com/microsoft/terminal/blob/master/src/types/ut_types/UtilsTests.cpp as discussed originally, if only for the reason of simplicity. I'll be happy to write an explicit test if that seems like a better idea to maintainers.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/2658 **State:** closed **Merged:** Yes --- <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This adds a few lines to support shorthand color hex codes like `#ABC`. They are treated as equivalent of `#AABBCC` <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References N/A <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #2639 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [x] Doesn't require documentation to be updated as far as I understand * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #2639 <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments The PR is only a few lines of code so should be self-explanatory. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed I've changed `src/cascadia/ut_app/JsonTests.cpp` thanks to the fact that Cascadia actually has a white color that can be expressed this way. The new test passes on my machine. I thought that change might be a better idea than adding a new test to https://github.com/microsoft/terminal/blob/master/src/types/ut_types/UtilsTests.cpp as discussed originally, if only for the reason of simplicity. I'll be happy to write an explicit test if that seems like a better idea to maintainers.
claunia added the pull-request label 2026-01-31 09:06:48 +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#25027