How to add Windows Terminal to the Windows Explorer context menu as “👩‍💻 Windows Terminal Here” ❔

The Windows context menu option ‘👩‍💻 Windows Terminal Here’ is handy to open Windows Terminal from Windows or Windows Explorer, 同時保持相同的路徑.
 

This tutorial assumes that Windows PowerShell is run as default when Windows Terminal is started

  1. Edit the registry as follows…

    啟動註冊表編輯器

    Win鍵 + R -> regedit -> Click OK

    顯示在註冊表編輯器中的地址欄,如果它尚未顯示

    View -> Address Bar

     

  2. Add the first registry entry to create the icon in the menu…

    註冊表路徑: HKEY_CLASSES_ROOT\Directory\Background\shell

    Right click shell -> New -> Key

    命名密鑰 Terminal

    編輯 (默認) 串到 Windows Terminal Here

    Right click the new key Terminal -> New -> String

    Name the new string Icon

    Download the Windows Terminal Icon…

    Windows Terminal Icon

    Open the Icon string and set the value as follows replacing {path to icon} 用自己的路:

    {path to icon}terminal.ico

     

  3. 添加第二個註冊表項

    註冊表路徑: HKEY_CLASSES_ROOT\Directory\Background\shell\Terminal

    Right click Terminal -> New -> Key

    Name the new key command

    在命令, set the value of (默認):

    wt -d .

     

  4. 添加第三註冊表項

    註冊表路徑: HKEY_CLASSES_ROOT\Directory\shell

    Right click shell -> New -> Key

    命名密鑰 Terminal

    編輯 (默認) 串到 Windows Terminal Here

    Right click the new key Terminal -> New -> String

    Name the new string Icon

    設置打開圖標和值,如下所示替換 {path to icon} 用自己的路:

    {path to icon}terminal.ico

     

  5. 添加第四註冊表項

    註冊表路徑: HKEY_CLASSES_ROOT\Directory\shell\Terminal

    Right click Terminal -> New -> Key

    In the new command key, 設置默認的值:

    wt -d .

     

上下文菜單現在應該是工作. Right click on the desktop and click Windows Terminal Here. Windows Terminal should open with PowerShell with the present working directory as your desktop.