[PR #6277] [MERGED] Find icon from shortcut target if shortcut doesn't specify it #26622

Open
opened 2026-01-31 09:17:11 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/6277
Author: @malxau
Created: 5/30/2020
Status: ✅ Merged
Merged: 6/1/2020
Merged by: @undefined

Base: master ← Head: malxau_shortcut_target


📝 Commits (1)

  • 4834be7 Find icon from shortcut target if shortcut doesn't specify it

📊 Changes

4 files changed (+45 additions, -15 deletions)

View changed files

📝 src/interactivity/win32/SystemConfigurationProvider.cpp (+29 -13)
📝 src/propsheet/PropSheetHandler.cpp (+1 -1)
📝 src/propslib/ShortcutSerialization.cpp (+13 -1)
📝 src/propslib/ShortcutSerialization.hpp (+2 -0)

📄 Description

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
5af366b6a5
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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/6277 **Author:** [@malxau](https://github.com/malxau) **Created:** 5/30/2020 **Status:** ✅ Merged **Merged:** 6/1/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `malxau_shortcut_target` --- ### 📝 Commits (1) - [`4834be7`](https://github.com/microsoft/terminal/commit/4834be7ae105424288dc849971debf47cac27435) Find icon from shortcut target if shortcut doesn't specify it ### 📊 Changes **4 files changed** (+45 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `src/interactivity/win32/SystemConfigurationProvider.cpp` (+29 -13) 📝 `src/propsheet/PropSheetHandler.cpp` (+1 -1) 📝 `src/propslib/ShortcutSerialization.cpp` (+13 -1) 📝 `src/propslib/ShortcutSerialization.hpp` (+2 -0) </details> ### 📄 Description 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 https://github.com/malxau/yori/commit/5af366b6a5ea4c92dce3940abb8616ab5bd300a6 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:17:11 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26622