[PR #5690] [CLOSED] Make profile names, scheme names case-insensitive #26429

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5690
Author: @zadjii-msft
Created: 5/1/2020
Status: Closed

Base: masterHead: dev/migrie/b/who-cares-about-case-sensitivity


📝 Commits (10+)

  • ff14bad This seems like it works as a test
  • 54a5bd2 Just from the test passing, I believe this will ship cmd.exe. Now time to actually play with it
  • 9583e04 Add the powershell case too
  • 841eff6 create the shim for powershell and Clear-Host as well
  • a4151c3 some doc comments I missed
  • f74d272 Make this only work for cmd.exe and powershell.exe
  • ed062ff pr comments
  • 2f61d55 Merge remote-tracking branch 'origin/master' into dev/migrie/b/3126-cls-shim
  • 2b953b4 whoops
  • 8707c18 yikes this is some real ded code

📊 Changes

13 files changed (+599 additions, -48 deletions)

View changed files

📝 .github/actions/spell-check/whitelist/whitelist.txt (+4 -0)
📝 src/cascadia/LocalTests_TerminalApp/ColorSchemeTests.cpp (+244 -0)
📝 src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp (+227 -18)
📝 src/cascadia/TerminalApp/CascadiaSettings.cpp (+20 -5)
📝 src/cascadia/TerminalApp/CascadiaSettings.h (+2 -1)
📝 src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp (+24 -14)
📝 src/cascadia/TerminalApp/ColorScheme.cpp (+7 -2)
📝 src/cascadia/TerminalApp/GlobalAppSettings.cpp (+30 -0)
📝 src/cascadia/TerminalApp/GlobalAppSettings.h (+4 -1)
src/cascadia/TerminalApp/IColorSchemeProvider.h (+29 -0)
📝 src/cascadia/TerminalApp/Profile.cpp (+5 -5)
📝 src/cascadia/TerminalApp/Profile.h (+2 -1)
📝 src/cascadia/TerminalApp/defaults.json (+1 -1)

📄 Description

Summary of the Pull Request

This PR changes profile names and color scheme names to be treated case-insensitively.

Profiles

  • For new-tab -p <profile name>, <profile name> can be case insensitive
  • For ShortcutActions that use profile (which accepts a "name"), the value of profile can be a case-insensitive name
  • For profiles with the case-insensitive same name, AND NO GUID, we'll still generate different GUIDs for them.
    • If you've got multiple profiles with the case-insensitive same name, only the first profile will be addressable by new-tab -p <name> and newTab actions.

Color Schemes

  • Schemes retain their case sensitive names internally
  • Schemes now layer on schemes with the same case-insensitive name (previously, they'd only layer on schemes with the same case-sensitive name).
  • We use a map<name, Scheme> to store schemes in the app settings. Now, we always store schemes under the std::towlower version of their name in that map.
  • Profiles can now specify a scheme by it's case-insensitive name

References

PR Checklist

  • Lets us rename Campbell Powershell to Campbell PowerShell
  • I work here
  • Tests added/passed
  • Requires documentation to be updated

Validation Steps Performed

  • image
  • Tried setting the color scheme of that profile to "bUiLtIn TaNgO dArK", that worked just fine
  • Added a "BUILTIN TANGO DARK" scheme that changed every color to rgb(255, 0, 0), boy was my terminal RED.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/5690 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 5/1/2020 **Status:** ❌ Closed **Base:** `master` ← **Head:** `dev/migrie/b/who-cares-about-case-sensitivity` --- ### 📝 Commits (10+) - [`ff14bad`](https://github.com/microsoft/terminal/commit/ff14bada3b58d91a680c6d22f7015147a7411230) This seems like it works as a test - [`54a5bd2`](https://github.com/microsoft/terminal/commit/54a5bd24100c57ec3f9e37c67d8e9a1e08b19756) Just from the test passing, I believe this will ship cmd.exe. Now time to actually play with it - [`9583e04`](https://github.com/microsoft/terminal/commit/9583e04605d6d4cb57d7f5df90674533ca499407) Add the powershell case too - [`841eff6`](https://github.com/microsoft/terminal/commit/841eff6281ce1353de671177407320b1d4707616) create the shim for powershell and Clear-Host as well - [`a4151c3`](https://github.com/microsoft/terminal/commit/a4151c320e879d24874d9b8a6baf23283b47dce2) some doc comments I missed - [`f74d272`](https://github.com/microsoft/terminal/commit/f74d272a8bc096e0dbf9804e8e22220855395073) Make this only work for cmd.exe and powershell.exe - [`ed062ff`](https://github.com/microsoft/terminal/commit/ed062ff46027003267e8a58904c88accd6d07c90) pr comments - [`2f61d55`](https://github.com/microsoft/terminal/commit/2f61d5565b523262722b10cfb83437e63f26c8be) Merge remote-tracking branch 'origin/master' into dev/migrie/b/3126-cls-shim - [`2b953b4`](https://github.com/microsoft/terminal/commit/2b953b40118f09f2e378020eece4ac4a563063e1) whoops - [`8707c18`](https://github.com/microsoft/terminal/commit/8707c1824cac68be5cf2ed83b69e13a3ea31a344) yikes this is some real ded code ### 📊 Changes **13 files changed** (+599 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spell-check/whitelist/whitelist.txt` (+4 -0) 📝 `src/cascadia/LocalTests_TerminalApp/ColorSchemeTests.cpp` (+244 -0) 📝 `src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp` (+227 -18) 📝 `src/cascadia/TerminalApp/CascadiaSettings.cpp` (+20 -5) 📝 `src/cascadia/TerminalApp/CascadiaSettings.h` (+2 -1) 📝 `src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp` (+24 -14) 📝 `src/cascadia/TerminalApp/ColorScheme.cpp` (+7 -2) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.cpp` (+30 -0) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.h` (+4 -1) ➕ `src/cascadia/TerminalApp/IColorSchemeProvider.h` (+29 -0) 📝 `src/cascadia/TerminalApp/Profile.cpp` (+5 -5) 📝 `src/cascadia/TerminalApp/Profile.h` (+2 -1) 📝 `src/cascadia/TerminalApp/defaults.json` (+1 -1) </details> ### 📄 Description ## Summary of the Pull Request This PR changes profile names and color scheme names to be treated case-insensitively. #### Profiles * For `new-tab -p <profile name>`, `<profile name>` can be case insensitive * For `ShortcutAction`s that use `profile` (which accepts a "name"), the value of `profile` can be a case-insensitive name * For profiles with the case-insensitive same `name`, AND NO GUID, we'll still generate different GUIDs for them. - If you've got multiple profiles with the case-insensitive same `name`, only the first profile will be addressable by `new-tab -p <name>` and `newTab` actions. #### Color Schemes * Schemes retain their case sensitive `name`s internally * Schemes now layer on schemes with the same case-insensitive `name` (previously, they'd only layer on schemes with the same case-sensitive `name`). * We use a `map<name, Scheme>` to store schemes in the app settings. Now, we always store schemes under the `std::towlower` version of their name in that map. * Profiles can now specify a scheme by it's case-insensitive `name` ## References ## PR Checklist * [x] Lets us rename `Campbell Powershell` to `Campbell PowerShell` * [x] I work here * [x] Tests added/passed * [ ] Requires documentation to be updated ## Validation Steps Performed * ![image](https://user-images.githubusercontent.com/18356694/80822764-03532e80-8ba1-11ea-9a8f-cd200e8d3198.png) * Tried setting the color scheme of that profile to "bUiLtIn TaNgO dArK", that worked just fine * Added a "BUILTIN TANGO DARK" scheme that changed every color to `rgb(255, 0, 0)`, boy was my terminal RED. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:16:02 +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#26429