From f140cdff2c30844401ed9f4c94509fa048d467fc Mon Sep 17 00:00:00 2001 From: mooons <10822203+mooons@users.noreply.github.com> Date: Wed, 3 Mar 2021 05:01:24 -0800 Subject: [PATCH 1/2] Show the context menu verb only when shift key is down --- src/cascadia/ShellExtension/OpenTerminalHere.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cascadia/ShellExtension/OpenTerminalHere.cpp b/src/cascadia/ShellExtension/OpenTerminalHere.cpp index 48b9cffe290..5106d4959c7 100644 --- a/src/cascadia/ShellExtension/OpenTerminalHere.cpp +++ b/src/cascadia/ShellExtension/OpenTerminalHere.cpp @@ -103,7 +103,15 @@ HRESULT OpenTerminalHere::GetState(IShellItemArray* /*psiItemArray*/, // We however don't need to bother with any of that, so we'll just return // ECS_ENABLED. - *pCmdState = ECS_ENABLED; + // Show the verb only when shift key is down + if ((GetKeyState(VK_SHIFT) & 0x8000) != 0) + { + *pCmdState = ECS_ENABLED; + } + else + { + *pCmdState = ECS_HIDDEN; + } return S_OK; } From 895029812808ccdf967badae30d5d2e78ba702c0 Mon Sep 17 00:00:00 2001 From: mooons <10822203+mooons@users.noreply.github.com> Date: Wed, 3 Mar 2021 05:02:37 -0800 Subject: [PATCH 2/2] Make verb display name consistent with "Open PowerShell window here" --- src/cascadia/ShellExtension/OpenTerminalHere.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cascadia/ShellExtension/OpenTerminalHere.cpp b/src/cascadia/ShellExtension/OpenTerminalHere.cpp index 5106d4959c7..84bde3218af 100644 --- a/src/cascadia/ShellExtension/OpenTerminalHere.cpp +++ b/src/cascadia/ShellExtension/OpenTerminalHere.cpp @@ -7,8 +7,8 @@ #include // TODO GH#6112: Localize these strings -static constexpr std::wstring_view VerbDisplayName{ L"Open in Windows Terminal" }; -static constexpr std::wstring_view VerbDevBuildDisplayName{ L"Open in Windows Terminal (Dev Build)" }; +static constexpr std::wstring_view VerbDisplayName{ L"Open Windows Terminal here" }; +static constexpr std::wstring_view VerbDevBuildDisplayName{ L"Open Windows Terminal here (Dev Build)" }; static constexpr std::wstring_view VerbName{ L"WindowsTerminalOpenHere" }; // This code is aggressively copied from