Skip to content

Wrong icon gets rendered when directly running apps in terminal (double click exe to open terminal tab). #13111

Closed

Description

@AraHaan

Windows Terminal version

1.13.10984.0

Windows build number

10.0.22000.0

Other Software

My Discord Bot v2.1.100.

On my Discord bot, it is designed to have an application icon. However when Windows Terminal is configured to be the default console host, all terminal tabs do not render the application icon when you directly double click it's executable file to run it.

Steps to reproduce

  1. Build an .NET Console application with an *.ico file for the program's icon, then double click the built output so it launches in Windows Terminal.

Expected Behavior

For the icon of the application to be rendered on the tab. On MacOS it renders the icon just fine, however that is in Apple's terminal.

Actual Behavior

A different icon is rendered and is provided from the OS or some other application instead?

Activity

  1. added
    Issue-Bug
    on May 16, 2022
  2. ghost added
    Needs-Triage
    on May 16, 2022
  3. ghost added
    Needs-Tag-Fix
    on May 16, 2022
  4. zadjii-msft commented on May 16, 2022

    @zadjii-msft
    Member

    Huh. Coulda swore we were tracking this somewhere, but doesn't look like it. #10669 looks vaguely related, but that's not it.

    For this to work, we'd probably need to some set of:

    we need to both be able to get the info on what the icon was supposed to be, and the ability to turn icons in dll's and exe's into XAML icons.

  5. added
    Area-UserInterface
    Product-Terminal
    Priority-3
    on May 16, 2022
  6. ghost removed
    Needs-Tag-Fix
    on May 16, 2022
  7. removed
    Needs-Triage
    on May 16, 2022
  8. AraHaan commented on May 16, 2022

    @AraHaan
    Author

    Cant one use the Windows API to obtain the icon information from the program that terminal is about to run (when it determines the program is about to execute directly) in order to use that information to simulate a profile with the icon?

    edit: something like https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadimagew

  9. zadjii-msft commented on May 16, 2022

    @zadjii-msft
    Member

    Yea probably. Trick there is converting the HANDLE that returns into something that can be used as the source for a XAML icon. If you can figure that out, the rest of this probably isn't too hard to wire up.

  10. DHowett commented on May 16, 2022

    @DHowett
    Member

    Mike Griese (@zadjii-msft) I'm comfortable calling this a dupe of both of those issues. The description for "pass LNK/EXE data" suggests making a fake runtime profile for the handed-off application, and part of that would be making sure it's got the right icon. We do both, we get icons!

    /dup #9458 #1504

  11. ghost closed this as completedon May 16, 2022
  12. ghost added
    Resolution-Duplicate
    on May 16, 2022
  13. DHowett commented on May 16, 2022

    @DHowett
    Member

    (Thanks for the report AraHaan!)

  14. AraHaan commented on May 16, 2022

    @AraHaan
    Author

    Yea probably. Trick there is converting the HANDLE that returns into something that can be used as the source for a XAML icon. If you can figure that out, the rest of this probably isn't too hard to wire up.

    On Winforms what I do is convert the HANDLE to an System.Drawing.Icon, and then convert the icon to an Bitmap, use the bitmap and icon for what I needed. I guess here could do something similar but have the bitmap saved to an temp bitmap file then try loading it as an XAML icon?

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-DefAppArea-UserInterfaceIssue-BugPriority-3Product-TerminalResolution-Duplicate

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions