The explorer context menu should only appear on shift+click #8453

Open
opened 2026-01-31 01:29:49 +00:00 by claunia · 3 comments
Owner

Originally created by @zadjii-msft on GitHub (May 21, 2020).

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.

Originally created by @zadjii-msft on GitHub (May 21, 2020). 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.
claunia added the Help WantedIssue-TaskProduct-TerminalArea-ShellExtension labels 2026-01-31 01:29:50 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jun 1, 2020):

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:

d16ebba9e0/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.

@zadjii-msft commented on GitHub (Jun 1, 2020): ~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](https://github.com/microsoft/terminal/pull/6100#discussion_r433367245): > > 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.
Author
Owner

@rescenic commented on GitHub (Jun 26, 2020):

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

@rescenic commented on GitHub (Jun 26, 2020): 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](https://i.ibb.co/zZChTNN/23-06-2020-863-23-33-27.png)
Author
Owner

@igorakkerman commented on GitHub (Jul 4, 2020):

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

@igorakkerman commented on GitHub (Jul 4, 2020): Please make this configurable, Terminal is a core application in my work and should not be a secondary function.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8453