Skip to content
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

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

Open
Tracked by #13392
brucejo75 opened this issue Mar 2, 2020 · 14 comments
Open
Tracked by #13392

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

brucejo75 opened this issue Mar 2, 2020 · 14 comments
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@brucejo75
Copy link

brucejo75 commented Mar 2, 2020

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.

@brucejo75 brucejo75 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Mar 2, 2020
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 2, 2020
@zadjii-msft
Copy link
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.

@zadjii-msft zadjii-msft added Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Mar 2, 2020
@brucejo75
Copy link
Author

brucejo75 commented Mar 2, 2020

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.

@brucejo75
Copy link
Author

brucejo75 commented Mar 2, 2020

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.

@zadjii-msft
Copy link
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.

@brucejo75
Copy link
Author

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

@DHowett-MSFT
Copy link
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.

@DHowett-MSFT DHowett-MSFT added Area-Settings Issues related to settings and customizability, for console or terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 6, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 6, 2020
@DHowett-MSFT DHowett-MSFT removed the Issue-Bug It either shouldn't be doing this or needs an investigation. label Mar 6, 2020
@DHowett-MSFT DHowett-MSFT added this to the Terminal Backlog milestone Mar 6, 2020
@DHowett-MSFT
Copy link
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.

@brucejo75
Copy link
Author

@DHowett-MSFT, any chance this will be addressed? Thanks!

@dc46and2
Copy link

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?

@gloatoriginal
Copy link

Is this still in the works?

@zadjii-msft
Copy link
Member

zadjii-msft commented Apr 28, 2023

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:

@stobor827
Copy link

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.

@zadjii-msft
Copy link
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.

@sebbu2
Copy link

sebbu2 commented Aug 15, 2024

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.

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-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

7 participants