Terminal: The explorer context menu should only appear on shift+click

Created on 22 May 2020  ·  3Comments  ·  Source: microsoft/terminal

Follow-up from #6100.

The Explorer context menu is notoriously cluttered. We shouldn't add to that clutter if we can avoid it. This issue represents me taking the time to investigate how exactly to make the menu only appear on shift+right click, not _just_ right click.

Area-ShellExtension Help Wanted Issue-Task Product-Terminal

Most helpful comment

Please make this configurable, Terminal is a core application in my work and should not be a secondary function.

All 3 comments

~Alright so we took a quick peek through the code and we're not sure exactly how to do this. Fortunately, PowerToys does seem to do something similar:~

~https://github.com/microsoft/PowerToys/blob/d16ebba9e0f06e7a0d41d981aeb1fd0a78192dc0/src/modules/powerrename/dll/PowerRenameExt.cpp#L60-L110~

~Looks like they implement another interface, IContextMenu. If someone in the community was passionate about decluttering the context menu, we'd definitely appreciate a similar PR 😄~

EDIT: As mentioned in an offline thread:

You should stick to the IExplorerCommand implementation and avoid IContextMenu if possible.

and also mentioned here:

If you return ECS_HIDDEN as a function of the keyboard state (if (GetKeyState(VK_SHIFT) < 0) or GetAsyncKeyState(), read the docs on both, I'm not sure which is the right one to use in this case) this can be hidden conditionally. This depends on the shell calling your handler coincident with presenting the UI. I think that is always true but might not always be. Pay attention to this issue and lets discuss with the File Explorer owners.

Yeah, it's ugly long name. I am trying to disable that context menu. But I can't find Windows Terminal Preview context menu item using Nirsoft tools, like ShellExView and ShellMenuView.
img

Please make this configurable, Terminal is a core application in my work and should not be a secondary function.

Was this page helpful?
0 / 5 - 0 ratings