'open in windows terminal' cant show in Directory Opuss context menu #12838

Closed
opened 2026-01-31 03:26:15 +00:00 by claunia · 6 comments
Owner

Originally created by @codeime on GitHub (Mar 3, 2021).

image

Originally created by @codeime on GitHub (Mar 3, 2021). ![image](https://user-images.githubusercontent.com/22333388/109806079-3baf1780-7c5f-11eb-9c71-2b159526fe6c.png)
Author
Owner

@zadjii-msft commented on GitHub (Mar 3, 2021):

I don't have any idea how Directory Opus is populating that context menu. I know that when I was first working on the context menu for explorer, I'd often have to hard-restart explorer.exe to have it reload the context menu entries. Perhaps you could try doing that with Directory Opus?

Otherwise I'm not really sure what we could do here - this sounds like a bug to file on Directory Opus.

@zadjii-msft commented on GitHub (Mar 3, 2021): I don't have any idea how Directory Opus is populating that context menu. I know that when I was first working on the context menu for explorer, I'd often have to hard-restart `explorer.exe` to have it reload the context menu entries. Perhaps you could try doing that with Directory Opus? Otherwise I'm not really sure what we could do here - this sounds like a bug to file on Directory Opus.
Author
Owner

@DHowett commented on GitHub (Mar 3, 2021):

It looks like Directory Opus is not enumerating all shell extensions. I wonder if they are doing it manually?

@DHowett commented on GitHub (Mar 3, 2021): It looks like Directory Opus is not enumerating all shell extensions. I wonder if they are doing it manually?
Author
Owner

@Nirmal4G commented on GitHub (Mar 7, 2021):

Directory Opus enumerates only Basic Shell Extensions, entries only in Shell and not in ShellEx (i.e. without class ids CLSID). You have to ask the Directory Opus guys to extend this feature.

@Nirmal4G commented on GitHub (Mar 7, 2021): **Directory Opus** enumerates only Basic Shell Extensions, entries only in `Shell` and not in `ShellEx` (_i.e. without class ids `CLSID`_). You have to ask the **Directory Opus** guys to extend this feature.
Author
Owner

@LeoDavidson commented on GitHub (Mar 8, 2021):

Directory Opus enumerates only Basic Shell Extensions, entries only in Shell and not in ShellEx (i.e. without class ids CLSID). You have to ask the Directory Opus guys to extend this feature.

Opus developer here. I don't know where that idea comes from? Opus's own shell extensions use the ShellEx keys in places.

Looking at Terminal, it does not appear to register its shell extension against the folder or directory type anywhere in the registry. (Please correct me if I'm wrong.)

It seems to be using C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.6.10571.0_x64__8wekyb3d8bbwe\AppManifest.xml. (Below the wonderful WindowsApps folder that is permissioned so you cannot list its contents, because that's super helpful.)

        <desktop4:Extension Category="windows.fileExplorerContextMenus">
          <desktop4:FileExplorerContextMenus>
            <desktop5:ItemType Type="Directory">
              <desktop5:Verb Id="Command1" Clsid="9f156763-7844-4dc4-b2b1-901f640f5155" />
            </desktop5:ItemType>
            <desktop5:ItemType Type="Directory\Background">
              <desktop5:Verb Id="Command2" Clsid="9f156763-7844-4dc4-b2b1-901f640f5155" />
            </desktop5:ItemType>
          </desktop4:FileExplorerContextMenus>
        </desktop4:Extension>

We support that kind of registration for preview handlers, but not for context menus. AFAIK there is no API for querying them, and finding them means searching the registry for every component under the PackagedCom registry key, and then loading and parsing each individual component's AppxManifest.xml file to see if it happens to add something to the type we're interested in.

We may look at adding support for this, but it seems like it could be bad for performance, with right-click menus being slow enough already due to all the shell extensions, unless there is a better way to do the query, e.g. an API. Especially when there are so few components using this method, with Terminal being the only one I'm aware of that is itself worth using.

Maybe there is a better way to query the XML registration that we aren't aware of? Documentation on this stuff is severely lacking, especially for people needing to query it from the Win32 side of things, unless things have improved in the last year or so.

(After the work we did on preview handler support for this kind of registration, only for Microsoft to then break and abandon their 3D Object Viewer preview handler and make that work a complete waste of time, I'm also a little reluctant to commit time to this for another Microsoft project.)

OTOH, if Terminal registers itself centrally in registry in the standard Win32 way, it would work automatically. Why Metro/Windows Store/whatever-they're-called-this-week-style apps don't/can't just do that, like every normal app on Windows has since Windows 95, rather than scatter settings around hundreds of xml files, I do not know.

@LeoDavidson commented on GitHub (Mar 8, 2021): > **Directory Opus** enumerates only Basic Shell Extensions, entries only in `Shell` and not in `ShellEx` (_i.e. without class ids `CLSID`_). You have to ask the **Directory Opus** guys to extend this feature. Opus developer here. I don't know where that idea comes from? Opus's own shell extensions use the ShellEx keys in places. Looking at Terminal, it does not appear to register its shell extension against the folder or directory type anywhere in the registry. (Please correct me if I'm wrong.) It seems to be using `C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.6.10571.0_x64__8wekyb3d8bbwe\AppManifest.xml`. (Below the wonderful WindowsApps folder that is permissioned so you cannot list its contents, because that's super helpful.) ``` <desktop4:Extension Category="windows.fileExplorerContextMenus"> <desktop4:FileExplorerContextMenus> <desktop5:ItemType Type="Directory"> <desktop5:Verb Id="Command1" Clsid="9f156763-7844-4dc4-b2b1-901f640f5155" /> </desktop5:ItemType> <desktop5:ItemType Type="Directory\Background"> <desktop5:Verb Id="Command2" Clsid="9f156763-7844-4dc4-b2b1-901f640f5155" /> </desktop5:ItemType> </desktop4:FileExplorerContextMenus> </desktop4:Extension> ``` We support that kind of registration for preview handlers, but not for context menus. AFAIK there is no API for querying them, and finding them means searching the registry for every component under the PackagedCom registry key, and then loading and parsing each individual component's AppxManifest.xml file to see if it happens to add something to the type we're interested in. We may look at adding support for this, but it seems like it could be bad for performance, with right-click menus being slow enough already due to all the shell extensions, unless there is a better way to do the query, e.g. an API. Especially when there are so few components using this method, with Terminal being the only one I'm aware of that is itself worth using. Maybe there is a better way to query the XML registration that we aren't aware of? Documentation on this stuff is severely lacking, especially for people needing to query it from the Win32 side of things, unless things have improved in the last year or so. (After the work we did on preview handler support for this kind of registration, only for Microsoft to then break and abandon their 3D Object Viewer preview handler and make that work a complete waste of time, I'm also a little reluctant to commit time to this for another Microsoft project.) OTOH, if Terminal registers itself centrally in registry in the standard Win32 way, it would work automatically. Why Metro/Windows Store/whatever-they're-called-this-week-style apps don't/can't just do that, like every normal app on Windows has since Windows 95, rather than scatter settings around hundreds of xml files, I do not know.
Author
Owner

@ghost commented on GitHub (Mar 12, 2021):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Mar 12, 2021): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@DHowett commented on GitHub (Mar 15, 2021):

OTOH, if Terminal registers itself centrally in registry in the standard Win32 way, it would work automatically. Why Metro/Windows Store/whatever-they're-called-this-week-style apps don't/can't just do that, like every normal app on Windows has since Windows 95, rather than scatter settings around hundreds of xml files, I do not know.

I wish I knew. I really do. ☹️

@DHowett commented on GitHub (Mar 15, 2021): > OTOH, if Terminal registers itself centrally in registry in the standard Win32 way, it would work automatically. Why Metro/Windows Store/whatever-they're-called-this-week-style apps don't/can't just do that, like every normal app on Windows has since Windows 95, rather than scatter settings around hundreds of xml files, I do not know. I wish I knew. I really do. ☹️
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12838