Skip to content

Feature request: wt.exe should display shortcut icon in taskbar #4768

Open

Description

Description of the new feature/enhancement

With a shortcut I can assign a wt.exe configuration per shortcut. But when the shortcut is run the wt.exe icon is shown not the shortcut icon.

This makes it hard to choose configurations short of opening each wt.exe window.

cmd.exe is an example of doing this well, it displays the icon of the shortcut when it is run. And each shortcut gets their own icon set in the taskbar for all windows started with that shortcut.

This would make it easy to set up specialized configs of wt.exe and be able to navigate between them easily.

This is similar to:

cmd.exe example

cmd.exe essentially has this feature. This should be able to be replicated by the Windows Terminal?

Create a shortcut1, target: C:\Windows\System32\cmd.exe
Add it's own icon. (Icon1)

Create a shortcut2 target: C:\Windows\System32\cmd.exe
Add it's own icon. (Icon2)

  1. Start shortcut1, Icon1 displays in the taskbar.
  2. Start shortcut2, Icon2 displays in the taskbar even though it is just a 2nd instance of cmd.exe.

Here is a screenshot:

CMD exe Icons

What you are looking at:
2 separate cmd.exe sessions on the left & 2 different bash.exe sessions on the right. Each with their own taskbar icon. Very easy to choose the right session from the taskbar.

Activity

  1. added
    Issue-Feature
    on Mar 2, 2020
  2. ghost added
    Needs-Tag-Fix
    on Mar 2, 2020
  3. ghost added
    Needs-Triage
    on Mar 2, 2020
  4. zadjii-msft commented on Mar 2, 2020

    @zadjii-msft
    Member

    I'm mildly worried that this is a platform bug. I'd bet that shortcuts to app execution aliases always use the app's icon, and not the shortcut's. We could pretty easily test this by adding a shortcut to ubuntu.exe (or another distro's launcher) and changing that icon.

  5. added
    Issue-Bug
    Priority-3
    Product-Terminal
    and removed
    Issue-Feature
    on Mar 2, 2020
  6. brucejo75 commented on Mar 2, 2020

    @brucejo75
    Author

    Works as described above with bash.exe & powershell.exe.

    Looking at task manager, cmd.exe shortcuts launches a console host / cmd.exe pair in an independent process.

    wt.exe looks like it spawns children for each launch?

    FYI: I just tried changing the icon on another app (robomongo.exe) and it displays different behavior than the cmd shell apps. It will use the new shortcut icon but any later invocations with other shortcuts will keep the icon of the original invocation shortcut.

  7. brucejo75 commented on Mar 2, 2020

    @brucejo75
    Author

    Also I know this feature is used extensively by Microsoft and the industry. It is a way to have an icon for a shell script invocation.

  8. zadjii-msft commented on Mar 2, 2020

    @zadjii-msft
    Member

    I mean, this is a bug in the sense that setting an icon for wt.exe doesn't apply to WT windows in the same way it does for conhost windows.

    My theory is really specific to app execution aliases - the platform does all sorts of weird things for "centennial" (packaged Win32 applications), and this might even be something they're tracking internally.

  9. brucejo75 commented on Mar 2, 2020

    @brucejo75
    Author

    ah, got it... I misunderstood. I will edit my comments...

  10. DHowett-MSFT commented on Mar 2, 2020

    @DHowett-MSFT
    Contributor

    Also, conhost has a heck lot of code written to make this work. The path to the lnk that spawned it is passed in STARTUPINFO, and conhost goes and cracks the link and does a resource load on the link's icon specifier.

    It's doable, it's just a lot of annoying gross Win32 work.

  11. added
    Area-Settings
    Issue-Feature
    and removed
    Needs-Triage
    on Mar 6, 2020
  12. ghost removed
    Needs-Tag-Fix
    on Mar 6, 2020
  13. removed
    Issue-Bug
    on Mar 6, 2020
  14. DHowett-MSFT commented on Mar 6, 2020

    @DHowett-MSFT
    Contributor

    This is a feature-sized fix, so I've triaged it into the backlog. If somebody wants to look at it, and we know it actually works with app execution alias invocation (it might not!), we'd entertain it.

  15. brucejo75 commented on Jul 10, 2020

    @brucejo75
    Author

    Dustin L. Howett (MSFT) (@DHowett-MSFT), any chance this will be addressed? Thanks!

  16. dc46and2 commented on Jan 31, 2023

    @dc46and2

    Also, conhost has a heck lot of code written to make this work. The path to the lnk that spawned it is passed in STARTUPINFO, and conhost goes and cracks the link and does a resource load on the link's icon specifier.

    We could work-around this if there were a command-line option to set the icon. Perhaps that would be easier to implement?

  17. gloa7 commented on Apr 23, 2023

    @gloa7

    Is this still in the works?

  18. zadjii-msft commented on Apr 28, 2023

    @zadjii-msft
    Member

    Is it still in the works

    I mean, no one's really taken a crack at it yet, so it's definitely still in the "ideation" phase.

    #1871 (comment) has some ideas on plumbing the tab's icon up as a "badge" on the Terminal's taskbar icon.

    I think there's maybe an overarching "I don't want different Terminal windows to glom together on the taskbar" request that's a part of this, and that I'm not sure we can do easily.
    I dunno if different windows with different badges will de-glom. There's some thoughts in #8216, but I'm not gonna try and mix and match this thread with that one.

    a now deprecated proposal

    Maybe there's room for making the setting for "taskbarBadges" an enum like:

    "taskbarIcon": "default" | "badge" | "replace" | <path>

    or similar.

    As a more comprehensive summarization:

    You know, after re-reading all this, I'm thinking that (#6556 + #14372) is a better solution for "I want to have a shortcut to a CLI application with a custom icon, and have the Terminal open with that icon"


    dev/migrie/f/4768-taskbar-icons has a WIP prototype. It can:

    • Set the taskbar overlay
    • Change the taskbar glomming, based on a runtime AUMID
    • Set the icon on the HWND, but NOT on the taskbar itself.

    settings proposal 2

    globals.showTaskbarOverlay: bool,
    globals.taskbarGlomBehavior: "default"|"window"|"profile",

    Also related:

  19. stobor827 commented on Jul 4, 2023

    @stobor827

    I was able to change the taskbar icon for terminal using these instructions, but it doesn't solve the issue of different icons for different profiles. Seems a bit hacky as well, may not be a feature to rely on.
    Maybe this has already been covered, but looks like the taskbar uses the appx id of the app to glom icons.
    If there was a way to duplicate/alias appx ids, that combined with the above would be a workaround for me, but not sure that's possible. (create a 'wsl' id and a 'ps' id that both point at the store-managed wt id and setup shortcuts that use those appropriately.) If you only had two profiles to switch between, you could use the 'preview' and 'release' builds from the store, heh.

  20. zadjii-msft commented on Aug 17, 2023

    @zadjii-msft
    Member

    I think this is gonna probably come down to #1871 + #8216 after all the discussions with the taskbar folks. Full up replacing our taskbar icon seems like a non-starter.

    Together, you could have different windows for different profiles, they wouldn't glom together, and they'd each have an overlay to indicate which profile they're running.

  21. sebbu2 commented on Aug 15, 2024

    @sebbu2

    It is incomplete, and I haven't check how it does it, but winget-cli already changes the icon of the tab inside terminal when retrieving the list, and also show a progress bar on the taskbar icon.

  22. genghiskMSFT commented on Nov 22, 2026

    @genghiskMSFT

    Also, conhost has a heck lot of code written to make this work. The path to the lnk that spawned it is passed in STARTUPINFO, and conhost goes and cracks the link and does a resource load on the link's icon specifier.

    It's doable, it's just a lot of annoying gross Win32 work.

    Happy to take a stab at this, but wanted to check w/you first - perhaps this is in-progress already, or there was a re-thinking of what the best approach is. I see chatter here about what's the best way to go about this, and it's unclear to me if consensus has been reached on the best way to solve this. I don't care much either way, just want Windows Terminal to honour the shortcut I see via the LNK file :) (it's a regression from Win95 as far as I am concerned)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SettingsIssue-FeaturePriority-3Product-Terminal

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions