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

Find icon from shortcut target if shortcut doesn't specify it #6277

Merged
1 commit merged into from
Jun 1, 2020

Conversation

malxau
Copy link
Contributor

@malxau malxau commented May 30, 2020

Implements what I was suggesting in #6266 where if a shortcut doesn't
specify an icon, the shortcut target full path is used before searching
for a matching executable in the path.

References

Found due to not getting the right icon in conhost from the Yori
installer. It's fixed in the installer from
malxau/yori@5af366b
for all current users of conhost though, so this PR is just trying to
minimize surprises for the next guy.

Detailed Description of the Pull Request / Additional comments

I know conhost and shortcut settings aren't really the team's focus
which is why I'm doing this. I understand though if there's a better
way or there are factors that I hadn't considered. Note that the path
searching code is used when programs are launched without using a
shortcut, and it will match if the working directory of the shortcut is
the directory containing the executable.

Validation Steps Performed

Created a shortcut that didn't specify an icon to a binary that wasn't
in the path, and verified that the icon in the upper left of the console
window could resolve correctly when opening the shortcut. I'm not aware
of a way to get into this path (of launching via a shortcut to a command
line process) without replacing the system conhost, which is what I did
to verify it. In order to diagnose it, I used hardcoded DebugBreak()
since even ImageFileExecutionOptions didn't like running against conhost-
is there are better way to debug and test these cases without being so
invasive on the system?

Closes #6266

@miniksa
Copy link
Member

miniksa commented Jun 1, 2020

In order to diagnose it, I used hardcoded DebugBreak() since even ImageFileExecutionOptions didn't like running against conhost - is there are better way to debug and test these cases without being so invasive on the system?

Not really, no. Conhost is gross to debug.

Copy link
Member

@miniksa miniksa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this. It seems reasonable to look at this path for context. Thanks.

@miniksa miniksa added 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. Needs-Second It's a PR that needs another sign-off Product-Conhost For issues in the Console codebase labels Jun 1, 2020
@ghost ghost requested review from zadjii-msft, carlos-zamora and leonMSFT June 1, 2020 17:00
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this. Thanks @malxau!

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jun 1, 2020
@ghost
Copy link

ghost commented Jun 1, 2020

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 601286a into microsoft:master Jun 1, 2020
@DHowett
Copy link
Member

DHowett commented Jun 1, 2020

Minor callout - there's this guy in our docs on debugging:

NOTE: conhost.exe already has a provision for a conditional DebugBreak() very early in the startup code if it was built in debug mode. Set HKCU\Console with DebugLaunch as a REG_DWORD with the value of 1.

@ghost
Copy link

ghost commented Jun 18, 2020

🎉Windows Terminal Preview v1.1.1671.0 has been released which incorporates this pull request.:tada:

Handy links:

@DHowett
Copy link
Member

DHowett commented Jul 2, 2020

🎉 Once again, thanks for the contribution!

This pull request was included in a set of conhost changes that was just
released with Windows Insider Build 20161.

@malxau malxau mentioned this pull request Nov 15, 2021
This pull request was closed.
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 AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Second It's a PR that needs another sign-off Product-Conhost For issues in the Console codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shortcut Icon Search doesn't look at fully qualified path
3 participants