Display current tab's icon as a badge on the taskbar icon #2637

Open
opened 2026-01-30 23:00:49 +00:00 by claunia · 25 comments
Owner

Originally created by @dave-c-whitney on GitHub (Jul 8, 2019).

I can assign individual icons for each profile, and each tab I open for said profile has that profile's icon on the tab. HOWEVER, the taskbar "button" has the primary app icon on it, which isn't as helpful as having the currently active tab's icon instead. The correct icon provides a visual cue on which taskbar button is "my" button I'm looking for.

Proposed technical implementation details (optional)

Originally created by @dave-c-whitney on GitHub (Jul 8, 2019). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> I can assign individual icons for each profile, and each tab I open for said profile has that profile's icon on the tab. HOWEVER, the taskbar "button" has the primary app icon on it, which isn't as helpful as having the currently active tab's icon instead. The correct icon provides a visual cue on which taskbar button is "my" button I'm looking for. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureHelp WantedProduct-TerminalArea-UserInterface labels 2026-01-30 23:00:49 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jul 8, 2019):

Is it even possible to change the taskbar icon for an exe at runtime?

@zadjii-msft commented on GitHub (Jul 8, 2019): Is it even possible to change the taskbar icon for an exe at runtime?
Author
Owner

@dave-c-whitney commented on GitHub (Jul 8, 2019):

I believe the taskbar icon matches the window's icon, which you can change at runtime.

@dave-c-whitney commented on GitHub (Jul 8, 2019): I believe the taskbar icon matches the window's icon, which you can change at runtime.
Author
Owner

@fredless commented on GitHub (Jul 8, 2019):

Is it even possible to change the taskbar icon for an exe at runtime?

Outlook does, and I've seen other (non-UWP) apps do it to implement faux-badging too.

That being said, I prefer the current static icon approach.

@fredless commented on GitHub (Jul 8, 2019): > Is it even possible to change the taskbar icon for an exe at runtime? Outlook does, and I've seen other (non-UWP) apps do it to implement faux-badging too. That being said, I prefer the current static icon approach.
Author
Owner

@dave-c-whitney commented on GitHub (Jul 8, 2019):

I feel a configuration switch coming on...

@dave-c-whitney commented on GitHub (Jul 8, 2019): I feel a configuration switch coming on...
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 8, 2019):

I'm inclined to just say "nah."

@DHowett-MSFT commented on GitHub (Jul 8, 2019): I'm inclined to just say "nah."
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 11, 2019):

I'm inclined to just say "this can actually be pretty useful" and stick it on the backlog. Thanks!

@DHowett-MSFT commented on GitHub (Jul 11, 2019): I'm inclined to just say "this can actually be pretty useful" and stick it on the backlog. Thanks!
Author
Owner

@cinnamon-msft commented on GitHub (Jul 15, 2019):

I had a little downtime today so I created these mockups 😊

image

@cinnamon-msft commented on GitHub (Jul 15, 2019): I had a little downtime today so I created these mockups 😊 ![image](https://user-images.githubusercontent.com/48369326/61248364-c0a29180-a707-11e9-936b-ea04a49da66a.png)
Author
Owner

@dave-c-whitney commented on GitHub (Jul 16, 2019):

How do they look downscaled to the size of the taskbar buttons? Are the adornments even visible any more?

@dave-c-whitney commented on GitHub (Jul 16, 2019): How do they look downscaled to the size of the taskbar buttons? Are the adornments even visible any more?
Author
Owner

@Summon528 commented on GitHub (Jul 16, 2019):

This might not be possible
See: https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/badges

You cannot provide your own badge image; only system-provided badge images can be used.

@Summon528 commented on GitHub (Jul 16, 2019): This might not be possible See: https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/badges > You cannot provide your own badge image; only system-provided badge images can be used.
Author
Owner

@oising commented on GitHub (Jul 16, 2019):

I looked into this before and found some information that may be pertinent here:

When Windows Installer creates shortcuts in the Start menu, it sets the icon of the shortcuts which point to Installer cache of icons. This feature is required for advertising, where the referenced file does not exist but still the correct icon should be shown. It also allows showing the correct icon to the application if its main .exe is removed (and you can run MSI repair to fix it).

Your application is started with shortcut from Startup folder, and the icon of the shortcut is used on the Taskbar. (And you have the main window: no matter how you show it, when app starts or only when you click app icon in the notification area; moreover you have to have a window to be able to get clicks from notification area icon.)

When you disabled pinning your app to the Taskbar, it ignores the icon set in the shortcut that started your application, and therefore icon on Taskbar updates when you change the window icon.

Basically, you can't update the taskbar icon at runtime unless you've disabled pinning.

@oising commented on GitHub (Jul 16, 2019): I looked into this before and found some information that may be pertinent here: > When Windows Installer creates shortcuts in the Start menu, it sets the icon of the shortcuts which point to Installer cache of icons. This feature is required for advertising, where the referenced file does not exist but still the correct icon should be shown. It also allows showing the correct icon to the application if its main .exe is removed (and you can run MSI repair to fix it). > > Your application is started with shortcut from Startup folder, and the icon of the shortcut is used on the Taskbar. (And you have the main window: no matter how you show it, when app starts or only when you click app icon in the notification area; moreover you have to have a window to be able to get clicks from notification area icon.) > > When you disabled pinning your app to the Taskbar, it ignores the icon set in the shortcut that started your application, and therefore icon on Taskbar updates when you change the window icon. Basically, you can't update the taskbar icon at runtime unless you've disabled pinning.
Author
Owner

@dave-c-whitney commented on GitHub (Jul 16, 2019):

No big deal. I don't have much of anything pinned.

@dave-c-whitney commented on GitHub (Jul 16, 2019): No big deal. I don't have much of anything pinned.
Author
Owner

@dsafa commented on GitHub (Jul 16, 2019):

There does exist a win32 api for adding overlay icons to the taskbar button which could be used for this ITaskbarList3::SetOverlayIcon.

A quick demo on what it would actually look like:
HfIW5KqMt1
hr70CDNU4O

@dsafa commented on GitHub (Jul 16, 2019): There does exist a win32 api for adding overlay icons to the taskbar button which could be used for this [ITaskbarList3::SetOverlayIcon](https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setoverlayicon). A quick demo on what it would actually look like: ![HfIW5KqMt1](https://user-images.githubusercontent.com/7334282/61321456-69142c80-a7c0-11e9-8cea-b4c334fc3fdf.gif) ![hr70CDNU4O](https://user-images.githubusercontent.com/7334282/61321460-69acc300-a7c0-11e9-93bf-29d854c46b5c.png)
Author
Owner

@oising commented on GitHub (Jul 17, 2019):

@dsafa -- the API doesn't allow arbitrary overlays: There's a fixed list. We could emulate what you show by replacing the entire icon though, under certain conditions.

@oising commented on GitHub (Jul 17, 2019): @dsafa -- the API doesn't allow arbitrary overlays: There's a fixed list. We could emulate what you show by replacing the _entire_ icon though, under certain conditions.
Author
Owner

@dsafa commented on GitHub (Jul 19, 2019):

With the UWP badges I do see the restrictions. However, with the older desktop api it does appear to be able to support arbitrary icons. The screenshot is from a quick implementation using a hardcoded image.

@dsafa commented on GitHub (Jul 19, 2019): With the UWP badges I do see the restrictions. However, with the older desktop api it does appear to be able to support arbitrary icons. The screenshot is from a quick implementation using a hardcoded image.
Author
Owner

@brucejo75 commented on GitHub (Mar 1, 2020):

Chiming in...

I think this option request is super useful. An alternative is to be able to set up icons for shortcuts that would display in the taskbar. Which currently doesn't work with wt.exe. But there is already a working example.

cmd.exe can use shortcut icons!

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.

Why is this useful?

My development involves at least the following environments:

  • Dev Machine with 2 different build environments. Each environment has a different set of environment variables. So each one gets their own session with icon.
  • Build machine that I SSH into. Another session with icon.
  • Deployed service machine(s) (livetest, staging, live) each session with icons.
  • MacOS machine for building iOS app builds (another icon)

Another complication: I tend to open 2-3 windows per environment when I am working on them.

So using Windows Terminal I could set up a SUPER session that had a tab for each environment and 2-3 panes per tab. Problem solved!

Except sometimes I need multiple environments visible on the screen at the same time and context switching between tabs can be a pain. So I set up a couple of shortcuts with a subset of environment tabs in each shortcut.

Or maybe an ideal is to set up each environment as a shortcut to a wt.exe session.

But figuring out which session belongs to which environment is a bear without a feature like this.

Added #4768 as a separate feature request.

@brucejo75 commented on GitHub (Mar 1, 2020): Chiming in... I think this option request is super useful. An alternative is to be able to set up icons for shortcuts that would display in the taskbar. Which currently doesn't work with `wt.exe`. But there is already a working example. ## `cmd.exe` can use shortcut icons! `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](https://user-images.githubusercontent.com/14342237/75634471-0b9fe500-5bc3-11ea-95d0-d554b8077f77.jpg) 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. ## Why is this useful? My development involves at least the following environments: - **Dev Machine** with 2 different build environments. Each environment has a different set of environment variables. So each one gets their own session with icon. - **Build machine** that I SSH into. Another session with icon. - **Deployed service machine(s)** (livetest, staging, live) each session with icons. - **MacOS machine** for building iOS app builds (another icon) Another complication: I tend to open 2-3 windows per environment when I am working on them. So using Windows Terminal I could set up a **SUPER** session that had a tab for each environment and 2-3 panes per tab. Problem solved! Except sometimes I need multiple environments visible on the screen at the same time and context switching between tabs can be a pain. So I set up a couple of shortcuts with a subset of environment tabs in each shortcut. Or maybe an ideal is to set up each environment as a shortcut to a `wt.exe` session. But figuring out which session belongs to which environment is a bear without a feature like this. Added #4768 as a separate feature request.
Author
Owner

@AnuthaDev commented on GitHub (Jun 21, 2020):

This should help: https://devblogs.microsoft.com/oldnewthing/20130211-00/?p=5283

@AnuthaDev commented on GitHub (Jun 21, 2020): This should help: https://devblogs.microsoft.com/oldnewthing/20130211-00/?p=5283
Author
Owner

@zadjii-msft commented on GitHub (Jul 26, 2021):

Note

Walkthrough

(not my best walkthrough, but a start)

Look at dev/migrie/f/4768-taskbar-icons for a start here. That's got code for making HICONs out of image files.

  • Add a global showTaskbarOverlay setting, that's a bool, to MTSMSettings.h
  • Plumb the profile icon path up from TerminalPage -> AppHost, whenever the active pane changes.
    • This should just be a PropertyChanged event, ala TitlebarBrush, FrameBrush.
    • What happens when the icon is a Web URL?
      • We probably just have to say that these won't work for now. I looked into BackgroundDownloader, but seemingly didn't work for packaged centennial apps.
    • What about ms-appx URIs?
  • Take the code from dev/migrie/f/4768-taskbar-icons, and move that into IconPathConverter somewhere. It needs a LOT of cleanup.
    • IconPathConverter is in terminal.settings.model. We need to use this up at the Window level, and that doesn't reference T.S.M.
    • _getIconIndex probably needs to get pulled out to a helper.
    • Don't do raw COM like that, use smart pointers.
    • Make sure that it works unpackaged.
    • Use smart pointers for the HICON et al.
    • Should we cache these HICON's in a map in the AppHost, so if we see the same URI again, we skip the generation? PROBABLY
  • ITaskbarList3::SetOverlayIcon to set the icon.
@zadjii-msft commented on GitHub (Jul 26, 2021): > **Note** > ## Walkthrough (not my best walkthrough, but a start) Look at [`dev/migrie/f/4768-taskbar-icons`](https://github.com/microsoft/terminal/compare/dev/migrie/f/4768-taskbar-icons) for a start here. That's got code for making HICONs out of image files. * [ ] Add a global `showTaskbarOverlay` setting, that's a bool, to `MTSMSettings.h` * [ ] Plumb the profile icon path up from `TerminalPage` -> `AppHost`, whenever the active pane changes. * This should just be a `PropertyChanged` event, ala `TitlebarBrush`, `FrameBrush`. * [x] What happens when the icon is a Web URL? * We probably just have to say that these won't work for now. I looked into `BackgroundDownloader`, but seemingly didn't work for packaged centennial apps. * [x] What about `ms-appx` URIs? * [ ] Take the code from `dev/migrie/f/4768-taskbar-icons`, and move that into ~`IconPathConverter`~ _somewhere_. It needs a LOT of cleanup. * `IconPathConverter` is in terminal.settings.model. We need to use this up at the Window level, and that doesn't reference T.S.M. * `_getIconIndex` probably needs to get pulled out to a helper. * [ ] Don't do raw COM like that, use smart pointers. * [ ] Make sure that it works unpackaged. * [ ] Use smart pointers for the HICON et al. * [ ] Should we cache these `HICON`'s in a map in the AppHost, so if we see the same URI again, we skip the generation? PROBABLY * [ ] [ITaskbarList3::SetOverlayIcon](https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setoverlayicon) to set the icon.
Author
Owner

@vemundha commented on GitHub (Jul 28, 2021):

Terminal should display tabs in the Windows taskbar as you get with E.g. ConEmu if you open multiple tabs. I have a setup with more than 20 tabs in ConEmu. And due to this missing feature in wt I'm still a ConEmu user. Yes and can open multiple windows with wt but then they are not docked together so it's not the same feature. So please add wt tabs to the Windows taskbar! 🙏

@vemundha commented on GitHub (Jul 28, 2021): Terminal should display tabs in the Windows taskbar as you get with E.g. ConEmu if you open multiple tabs. I have a setup with more than 20 tabs in ConEmu. And due to this missing feature in wt I'm still a ConEmu user. Yes and can open multiple windows with wt but then they are not docked together so it's not the same feature. So please add wt tabs to the Windows taskbar! 🙏
Author
Owner

@zadjii-msft commented on GitHub (Jul 28, 2021):

@vemundha the thread you're probably interested in is #687

@zadjii-msft commented on GitHub (Jul 28, 2021): @vemundha the thread you're probably interested in is #687
Author
Owner

@zadjii-msft commented on GitHub (Apr 28, 2023):

xlink: https://github.com/microsoft/terminal/issues/4768#issuecomment-1527800607 has the most comprehensive summary of the problem space

@zadjii-msft commented on GitHub (Apr 28, 2023): xlink: https://github.com/microsoft/terminal/issues/4768#issuecomment-1527800607 has the most comprehensive summary of the problem space
Author
Owner

@kiruthikpurpose commented on GitHub (Oct 21, 2024):

This feature would greatly enhance usability by allowing users to quickly identify the active tab through taskbar icons, especially for those managing multiple profiles and sessions simultaneously. Implementing this could also be configurable, giving users the option to enable or disable this feature based on personal preference. I agree that caching HICONs for repeated icons is a smart optimization to avoid unnecessary re-generation. The complexity around web URL icons can be handled in future iterations, but for now, supporting local and packaged icons should cover most cases.

@kiruthikpurpose commented on GitHub (Oct 21, 2024): This feature would greatly enhance usability by allowing users to quickly identify the active tab through taskbar icons, especially for those managing multiple profiles and sessions simultaneously. Implementing this could also be configurable, giving users the option to enable or disable this feature based on personal preference. I agree that caching HICONs for repeated icons is a smart optimization to avoid unnecessary re-generation. The complexity around web URL icons can be handled in future iterations, but for now, supporting local and packaged icons should cover most cases.
Author
Owner

@Aliremu commented on GitHub (Jan 20, 2026):

Hi! Is anyone working on this? I have a small prototype working, but wanted to make sure no one's already working on this first or if there are other plans. Also had a few questions about what to do with glyph icons (settings, remote machine, etc) and split panes.

https://github.com/user-attachments/assets/eb79ff26-eb3c-4a32-afe0-06eeb8ca1039

@Aliremu commented on GitHub (Jan 20, 2026): Hi! Is anyone working on this? I have a small prototype working, but wanted to make sure no one's already working on this first or if there are other plans. Also had a few questions about what to do with glyph icons (settings, remote machine, etc) and split panes. https://github.com/user-attachments/assets/eb79ff26-eb3c-4a32-afe0-06eeb8ca1039
Author
Owner

@DHowett commented on GitHub (Jan 21, 2026):

@aliremu this is amazing! feel free to work on it and maybe eventually PR it - we can discuss it over there :)

IMO, we should be able to get a pretty quick handle on a rendering context that'll let us rasterize glyph and emoji icons; split panes will be something else entirely (and something I have long wished to expose better in the UI overall) and probably need some design aforethought

@DHowett commented on GitHub (Jan 21, 2026): @aliremu this is amazing! feel free to work on it and maybe eventually PR it - we can discuss it over there :) IMO, we should be able to get a pretty quick handle on a rendering context that'll let us rasterize glyph and emoji icons; split panes will be something else entirely (and something I have long wished to expose better in the UI overall) and probably need some design aforethought
Author
Owner

@zadjii-msft commented on GitHub (Jan 21, 2026):

That demo is awesome, ship it :shipit:

  • I think it's fine for preview to acknowledge that emoji & glyphs won't work for that feature yet.
  • As far as split panes: we already just use the icon of the active pane as the tab's icon. I think that's fine to replicate here.
@zadjii-msft commented on GitHub (Jan 21, 2026): That demo is awesome, ship it :shipit: * I think it's fine for preview to acknowledge that emoji & glyphs won't work for that feature yet. * As far as split panes: we already just use the icon of the active pane as the tab's icon. I think that's fine to replicate here.
Author
Owner

@oising commented on GitHub (Jan 23, 2026):

Beautiful! Great job, @Aliremu !

@oising commented on GitHub (Jan 23, 2026): Beautiful! Great job, @Aliremu !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2637