Skip to content

Dark and Light Profile Icons #19074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Techypanda
Copy link

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

#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

  • Closes Per-theme-mode profile icons #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 and link it here: #xxx
  • Schema updated (if necessary) => Will Update

@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Task It's a feature request, but it doesn't really need a major design. Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. labels Jun 27, 2025
@Techypanda Techypanda force-pushed the per-theme-profileicon branch from efe9cdc to 2303f57 Compare June 27, 2025 04:02

This comment has been minimized.

This commit adds the ability to swap between dark and light icons for a profile, this is a additive change so you can either keep using the string icon or you can now swap to a object form in which you specify a light property for light theme and dark for dark theme
@Techypanda Techypanda force-pushed the per-theme-profileicon branch from 2303f57 to 745f7e3 Compare June 27, 2025 04:15
@Techypanda Techypanda marked this pull request as ready for review June 27, 2025 04:20
@Techypanda
Copy link
Author

Techypanda commented Jun 27, 2025

need to swap to using theme from currenttheme rather then system

@Techypanda Techypanda marked this pull request as draft June 27, 2025 06:16
@Techypanda
Copy link
Author

need to take another approach to this, closing for now (incase anyone else wants to work on this issue) while i work on this

@Techypanda Techypanda closed this Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Per-theme-mode profile icons
1 participant