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

No Windows Terminal selection in PowerToys Run #16118

Closed
1 task
kvnxiao opened this issue Feb 6, 2022 · 22 comments
Closed
1 task

No Windows Terminal selection in PowerToys Run #16118

kvnxiao opened this issue Feb 6, 2022 · 22 comments
Labels
Issue-Bug Something isn't working Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Run-Results (Programs) Issue with program search in PowerToys Run

Comments

@kvnxiao
Copy link

kvnxiao commented Feb 6, 2022

Microsoft PowerToys version

0.55.1

Running as admin

  • Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

Prerequisite: Windows Terminal installed via Microsoft Store

Reproduction Steps:

  • Press hotkey to activate PowerToys Run bar (Alt+Space)
  • Type in term...
  • No Terminal or Windows Terminal packaged application option shows up

image

✔️ Expected Behavior

Expect to see Windows Terminal

I believe this was working before, but I am not sure if it was a version update that caused this issue or an issue with my installation / configuration.

❌ Actual Behavior

No Terminal or Windows Terminal packaged application option shows up

Other Software

Windows Terminal
Version: 1.12.10334.0

image

@kvnxiao kvnxiao added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Feb 6, 2022
@franky920920
Copy link
Contributor

Failed to reproduce this.
Could you attach a full bug report file?
Right-click on the tray icon and click Report Bug. Then drag-and-drop the generated file into the GitHub comment to upload it. Thanks!
image
/needinfo

@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Feb 6, 2022
@franky920920 franky920920 added Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Results (Programs) Issue with program search in PowerToys Run labels Feb 6, 2022
@kvnxiao
Copy link
Author

kvnxiao commented Feb 6, 2022

@ghost ghost added Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Feb 6, 2022
@franky920920
Copy link
Contributor

franky920920 commented Feb 6, 2022

[2022-02-05 23:31:30.0169] [ERROR] [C:\a_work\1\s\src\modules\launcher\Plugins\Microsoft.Plugin.Program\Programs\UWPApplication.cs::357]

-------------------------- Begin exception --------------------------
Message: 	Error status: KNOWN
		Program path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.12.10334.0_x64__8wekyb3d8bbwe
		Exception thrown in called method: Not available
		Possible interpretation of the error: Load pri failed @{Microsoft.WindowsTerminal_1.12.10334.0_x64__8wekyb3d8bbwe? ms-resource:///resources/TerminalApp/ContextMenu/AppDescription} with HResult -2147009769 and location C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.12.10334.0_x64__8wekyb3d8bbwe
		Possible resolution: Can be ignored and PowerToys Run should still continue, however the program may not be loaded

Exception full name  : System.Runtime.InteropServices.COMException
Exception message    : NamedResource Not Found. (0x80073B17)
Exception stack trace:

Exception source     : 
Exception target site: 
Exception HResult    : -2147009769
-------------------------- End exception --------------------------

@MikenTNT
Copy link

MikenTNT commented Feb 6, 2022

I have the same problem, since the last Windows Terminal app update.

Windows Terminal
Version: 1.12.10334.0

@htcfreek
Copy link
Collaborator

htcfreek commented Feb 6, 2022

With the last update wt is renamed from Windows Terminal to Terminal. Might be the reason.

@kvnxiao , @MikenTNT
Does only the app search dosn't work or is the terminal plugin broken too?

I can't test it as the store doesn't show me the wt update. (@DHowett when will the update be available in store?)

@htcfreek
Copy link
Collaborator

htcfreek commented Feb 6, 2022

[2022-02-05 23:31:30.0169] [ERROR] [C:\a_work\1\s\src\modules\launcher\Plugins\Microsoft.Plugin.Program\Programs\UWPApplication.cs::357]

-------------------------- Begin exception --------------------------
Message: 	Error status: KNOWN
		Program path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.12.10334.0_x64__8wekyb3d8bbwe
		Exception thrown in called method: Not available
		Possible interpretation of the error: Load pri failed @{Microsoft.WindowsTerminal_1.12.10334.0_x64__8wekyb3d8bbwe? ms-resource:///resources/TerminalApp/ContextMenu/AppDescription} with HResult -2147009769 and location C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.12.10334.0_x64__8wekyb3d8bbwe
		Possible resolution: Can be ignored and PowerToys Run should still continue, however the program may not be loaded

Exception full name  : System.Runtime.InteropServices.COMException
Exception message    : NamedResource Not Found. (0x80073B17)
Exception stack trace:

Exception source     : 
Exception target site: 
Exception HResult    : -2147009769
-------------------------- End exception --------------------------

Strange that we try to read context menu resource.

@DHowett
Can there be a bug in the resource file after renaming?

@MikenTNT
Copy link

MikenTNT commented Feb 6, 2022

With the last update wt is renamed from Windows Terminal to Terminal. Might be the reason.

@kvnxiao , @MikenTNT Does only the app search dosn't work or is the terminal plugin broken too?

I can't test it as the store doesn't show me the wt update. (@DHowett when will the update be available in store?)

It's just the app search, the terminal plugin is still working.

@DHowett
Copy link
Member

DHowett commented Feb 6, 2022

I'm surprised Run isn't handling this properly already. That exception suggests that it's failing to read DisplayName when it is a localized resource... which it is in almost all first-party applications, like Calculator.

@crutkas crutkas removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up labels Feb 8, 2022
@crutkas
Copy link
Member

crutkas commented Feb 8, 2022

I can confirm this is an issue now. I think we'll have to literally rewrite how the UWP code path works to get some of this to work. I think this may be a good idea based on the complexity it looks like is there for some reason. Not totally sure why we didn't just use PackageManager class from the start e2e as it already is used for monitoring stuff

@crutkas crutkas added the Priority-0 Bugs that we consider release-blocking/recall-class (P0) label Feb 8, 2022
@stefansjfw
Copy link
Collaborator

stefansjfw commented Feb 9, 2022

@DHowett @crutkas The problem here is the way we're forming the resource key to look for in resources.pri file.

I was testing this with Terminal Preview app which experiences the same issue (as I don't have option to update Terminal on Win10). So, for the previous version of Terminal (when PT Run worked and Program plugin could found Terminal correctly) we were looking for the AppName and AppDescription keys with the following paths in resources.pri:
AppName -> ms-resource:///resources/AppName
AppDescription -> ms-resource:///resources/AppDescription

**Insert from dump of Terminal (OLDER VERSION THAT WORKS WITH PT RUN) resource.pri file**
			<NamedResource name="AppDescription" uri="ms-resource://Microsoft.WindowsTerminal/Resources/AppDescription">
...
			<NamedResource name="AppName" uri="ms-resource://Microsoft.WindowsTerminal/Resources/AppName">

where we append Resources subtree manually in front of the key name here https://github.com/microsoft/PowerToys/blob/main/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/UWPApplication.cs#L327.

That way, we construct following paths for Terminal Preview app:
AppName -> ms-resource:///resources/TerminalApp/ContextMenu/AppNamePre
AppDescription -> ms-resource:///resources/TerminalApp/ContextMenu/AppDescriptionPre

But after dumping the resources.pri file of Terminal Preview app (using MakePri.exe tool), I see that needed keys are not in the Resource subtree.
So the correct paths for Terminal Preview app are:
AppName -> ms-resource:///TerminalApp/ContextMenu/AppNamePre
AppDescription -> ms-resource:///TerminalApp/ContextMenu/AppDescriptionPre

(Note there is no resources subtree)

**Insert from dump of Terminal Preview (DOESN'T WORK WITH PT RUN) resource.pri file**
				<NamedResource name="AppDescription" uri="ms-resource://Microsoft.WindowsTerminalPreview/TerminalApp/ContextMenu/AppDescription">
...
				<NamedResource name="AppName" uri="ms-resource://Microsoft.WindowsTerminalPreview/TerminalApp/ContextMenu/AppName">

I can confirm that following paths works for Terminal Preview and the app is correctly loaded into Program plugin.
So, I'll see how to modify the way we are forming the key, to support both cases (with and without 'Resources' subtree correctly).

@htcfreek
Copy link
Collaborator

htcfreek commented Feb 9, 2022

@DHowerr @crutkas The problem here is the way we're forming the resource key to look for in resources.pri file.

I was testing this with Terminal Preview app which experiences the same issue (as I don't have option to update Terminal on Win10). So, for the previous version of Terminal (when PT Run worked and Program plugin could found Terminal correctly) we were looking for the AppName and AppDescription keys with the following paths in resources.pri:
AppName -> ms-resource://Microsoft.WindowsTerminal/Resources/AppName
AppDescription -> ms-resource://Microsoft.WindowsTerminal/Resources/AppDescription

where we append Resources subtree manually here https://github.com/microsoft/PowerToys/blob/main/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/UWPApplication.cs#L327.

That way, we construct following paths for Terminal Preview app:
AppName -> ms-resource:///resources/TerminalApp/ContextMenu/AppNamePre
AppDescription -> ms-resource:///resources/TerminalApp/ContextMenu/AppDescriptionPre

But after dumping the resources.pri file of Terminal Preview app, I see that needed keys are not in the Resource subtree.
So the correct paths for Terminal Preview app are:
AppName -> ms-resource:///TerminalApp/ContextMenu/AppNamePre
AppDescription -> ms-resource:///TerminalApp/ContextMenu/AppDescriptionPre

(Note there is no resources subtree)

I can confirm that following paths works for Terminal Preview and the app is correctly loaded into Program plugin.
So, I'll see how to modify the way we are forming the key, to support both cases (with and without 'Resources' subtree correctly).

@DHowett

@stefansjfw
Copy link
Collaborator

Thanks @htcfreek :)

@crutkas
Copy link
Member

crutkas commented Feb 10, 2022

@stefansjfw synced with @DHowett sounds like good solution

@davidjade
Copy link

Just wanted to comment I have a similar but not quite the same experience on Windows 10. "Windows Terminal" shows up but "Terminal Preview" does not anymore. I have both installed and I typically use the preview version.

Both apps show on the regular Start Menu search.

@kvnxiao
Copy link
Author

kvnxiao commented Feb 11, 2022

@davidjade Do you have Version: 1.12.10334.0 installed for Windows Terminal? The issue is in newer versions of Windows Terminal, and PowerTools run not accounting for the changes, if you read the above in this thread.

@davidjade
Copy link

I have Windows Terminal 1.11.3471.0 and Terminal Preview 1.13.10336.0, so I guess that explains it. I missed that this was tied to the Terminal version and not PT Run version.

@kvnxiao
Copy link
Author

kvnxiao commented Feb 11, 2022

It is tied to both apps -- the problem is a mix of both. tl;dr WT changed the way the resource for display name is stored, PTRun needs to be updated to look under alternate paths

@crutkas
Copy link
Member

crutkas commented Feb 11, 2022

We will have a fix come 0.56 for this.

@franky920920
Copy link
Contributor

For a workaround, you can use wt in PowerToys run instead. :D

@crutkas
Copy link
Member

crutkas commented Feb 13, 2022

The PR to fix this is open. #16265

Will be wrapped up soon and fixed with 0.56

@stefansjfw stefansjfw added the Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. label Feb 14, 2022
ghost pushed a commit to microsoft/terminal that referenced this issue Feb 15, 2022
We chose to use the "ContextMenu" resource compartment when we
changed the package name to Terminal in #12264 because it was more
broadly localized than the rest of the application.

It appears as though some platform features have trouble with the
"more qualified" resource paths that #12264 required.

To fix this, we will:

1. Copy all of the ContextMenu localizations into CascadiaPackage's
   resource root
2. Switch all manifest resource paths to use resources from the package
   root.

Regressed in #12264
Closes #12384
Closes #12406 (tracked in microsoft/PowerToys#16118)
DHowett added a commit to microsoft/terminal that referenced this issue Feb 16, 2022
We chose to use the "ContextMenu" resource compartment when we
changed the package name to Terminal in #12264 because it was more
broadly localized than the rest of the application.

It appears as though some platform features have trouble with the
"more qualified" resource paths that #12264 required.

To fix this, we will:

1. Copy all of the ContextMenu localizations into CascadiaPackage's
   resource root
2. Switch all manifest resource paths to use resources from the package
   root.

Regressed in #12264
Closes #12384
Closes #12406 (tracked in microsoft/PowerToys#16118)

(cherry picked from commit 9501b23)
DHowett added a commit to microsoft/terminal that referenced this issue Feb 16, 2022
We chose to use the "ContextMenu" resource compartment when we
changed the package name to Terminal in #12264 because it was more
broadly localized than the rest of the application.

It appears as though some platform features have trouble with the
"more qualified" resource paths that #12264 required.

To fix this, we will:

1. Copy all of the ContextMenu localizations into CascadiaPackage's
   resource root
2. Switch all manifest resource paths to use resources from the package
   root.

Regressed in #12264
Closes #12384
Closes #12406 (tracked in microsoft/PowerToys#16118)

(cherry picked from commit 9501b23)
@isuwill
Copy link

isuwill commented Feb 17, 2022

Thanks for your work on fixing this bug!

Since the Ctrl-Shift-Enter trick to launch a start menu item as admin, I've been really appreciating PowerToys Run. I was sad to see that Windows Terminal had disappeared, but it was nice to learn from Franky that I could just use wt to launch terminal.

As I was missing the strange joy I experience when I see PT Run visually narrowing down my options as I type terminal, I came up with another work around that I wanted to share.

I created a Windows Terminal shortcut in a new folder, C:\ProgramData\Microsoft\Windows\Start Menu\Programs\SpecialApps, I created for this workaround purpose. Now it shows up in PT Run like it did before.

@crutkas
Copy link
Member

crutkas commented Mar 3, 2022

This is fixed with 0.561. Please head over to https://aka.ms/installpowertoys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Run-Results (Programs) Issue with program search in PowerToys Run
Projects
None yet
Development

No branches or pull requests

9 participants