[PR #19074] Dark and Light Profile Icons #31700

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

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

State: closed
Merged: No


Summary of the Pull Request

This PR adds the ability to swap between dark and light icons for a profile based off your windows theme (Dark Theme or Light Theme).
This is an additive change so you can either keep using the string icon or you can now swap to an object form in which you specify a light property for light theme and dark for dark theme, e.g. for testing i used:

{
                "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "hidden": false,
                "icon": {
                    "light": ":)",
                    "dark": ":("
                }, <-- Complex Object Form
                "name": "Windows PowerShell"
            },
            {
                "colorScheme": "Color Scheme 15",
                "commandline": "%SystemRoot%\\System32\\cmd.exe",
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "hidden": false,
                "icon": "!", <-- Normal String Icon
                "name": "Command Prompt"
            }

References and Relevant Issues

https://github.com/microsoft/terminal/issues/15264

Detailed Description of the Pull Request / Additional comments

This PR adds a new type ProfileIcon with relevant IDL, then it edits the profile IDL to allow setting the field 'icon' to either this complex type ProfileIcon or the original string type to maintain compatability without breaking people.

I tried to utilize some form of union in MIDL but got very confused (I'm not actually sort I can use a union in MIDL3.0?) so i ended up with hacky if statements.

I also edited it so that when a theme change occurs on windows which triggers the RefreshUIForSettingsReload method, it will now call a new method called 'ResetEvaluated' that just resets the evaluated icon forcing a new lookup, this makes it so if you do a update the terminal tabs have updated icons.

Validation Steps Performed

Used above profile and tested locally for a bit, appears to work quite well

PR Checklist

**Original Pull Request:** https://github.com/microsoft/terminal/pull/19074 **State:** closed **Merged:** No --- ## Summary of the Pull Request This PR adds the ability to swap between dark and light icons for a profile based off your windows theme (Dark Theme or Light Theme). This is an additive change so you can either keep using the string icon or you can now swap to an object form in which you specify a light property for light theme and dark for dark theme, e.g. for testing i used: ``` { "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "hidden": false, "icon": { "light": ":)", "dark": ":(" }, <-- Complex Object Form "name": "Windows PowerShell" }, { "colorScheme": "Color Scheme 15", "commandline": "%SystemRoot%\\System32\\cmd.exe", "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "hidden": false, "icon": "!", <-- Normal String Icon "name": "Command Prompt" } ``` ## References and Relevant Issues https://github.com/microsoft/terminal/issues/15264 ## Detailed Description of the Pull Request / Additional comments This PR adds a new type ProfileIcon with relevant IDL, then it edits the profile IDL to allow setting the field 'icon' to either this complex type ProfileIcon or the original string type to maintain compatability without breaking people. I tried to utilize some form of union in MIDL but got very confused (I'm not actually sort I can use a union in MIDL3.0?) so i ended up with hacky if statements. I also edited it so that when a theme change occurs on windows which triggers the `RefreshUIForSettingsReload` method, it will now call a new method called 'ResetEvaluated' that just resets the evaluated icon forcing a new lookup, this makes it so if you do a update the terminal tabs have updated icons. ## Validation Steps Performed Used above profile and tested locally for a bit, appears to work quite well ## PR Checklist - [x] Closes #15264 - [ ] Tests added/passed => Need guidance as to what tests to add/edit - [ ] Documentation updated => Will update to docs repo - If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx - [ ] Schema updated (if necessary) => Will Update
claunia added the pull-request label 2026-01-31 09:48:58 +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#31700