12

Microsoft released Windows terminal as a Microsoft Store app. How to add it to the context menu or replace 'Open Powershell window here' with it ?

Steev James
  • 969
  • 1
  • 11
  • 23
  • See https://www.digitalcitizen.life/add-control-panel-and-command-prompt-winx-menu-windows-10 or https://winaero.com/comment.php?comment.news.30 – Nico Nekoru Apr 24 '20 at 16:49
  • @NekoMusume That was not what I was asked about. Windows Terminal is an new type of app that you can download from the Microsoft Store. See here : https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701 – Steev James Apr 25 '20 at 17:31
  • I know that, with the link you can edit the win-x menu to make it so that instead of cmd it is an app – Nico Nekoru Apr 27 '20 at 15:02
  • @NekoMusume, Yes, but the reason to open it with context menu is because we have to open in a given folder. It can't be done with Win+x right.... – Steev James Apr 28 '20 at 08:05
  • the Win-X Menu shortcuts are stored in `%LOCALAPPDATA%\Microsoft\Windows\WinX`, the editor linked is just an easier way to access this. See https://github.com/microsoft/terminal/issues/1421 – Nico Nekoru Apr 28 '20 at 20:34
  • The folder windows terminal is located in is `"%programfiles%\WindowsApps\Microsoft.WindowsTerminal_0.11.1121.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"` – Nico Nekoru Apr 28 '20 at 20:46

2 Answers2

42

There might have been several approaches discussed everywhere, but none of them is up-to-date nor offers flexibility. So I started a new open source project and provided two PowerShell scripts to help.

https://github.com/lextm/windowsterminal-shell

You can run install.ps1 as administrator in PowerShell 7 to easily add the default layout.

enter image description here

There are other layouts (mini and flat at this moment).

Uninstall the menu items are also easy with uninstall.ps1.

Lex Li
  • 52,595
  • 8
  • 102
  • 129
  • Awesome! The only problem is that, if I update WT, whether the icon will be missing? – alexzshl May 25 '20 at 11:39
  • @alexzshl Unless you change profiles, the menu items should continue to work as they bind to version neutral executable path. – Lex Li May 25 '20 at 14:09
  • 1
    Despite the fact that this answer is valid, For quite some time, there is a PowerShell module called [OpenHere](https://github.com/KUTlime/PowerShell-Open-Here-Module) that gives you granular options to control this functionality. All you need is to copy paste this into PowerShell with elevated rights: `Install-Module -Name OpenHere; Import-Module -Name OpenHere` and start to explore the `Set-OpenHereShortcut` function. Disclosure: I'm a developer of this module. – KUTlime Aug 25 '20 at 10:05
  • 1
    @KUTlime thanks for sharing but the two are completely different. Your module does not open Windows Terminal, so not for this question. – Lex Li Aug 25 '20 at 13:14
  • 1
    @LexLi Please, review ReadMe again. It does open Windows Terminal. – KUTlime Aug 25 '20 at 13:47
  • @KUTlime then please post your own answer. Our scripts differ significantly. For example, the menu item cmd in the screen shot above does not open cmd.exe but Windows Terminal to wrap cmd.exe. That's not something your script supports. – Lex Li Aug 25 '20 at 14:56
  • @LexLi This question is closed and there was no other way to share the knowledge. – KUTlime Aug 26 '20 at 08:27
  • 1
    @LexLi this is great! It works for me since I can't get the latest Windows updates that include this natively. One question, though - is there any way to modify the behavior so that new terminal sessions open as tabs in an existing session? – grt3kl Sep 15 '20 at 14:39
  • This unfortunately this doesnt seems to work with the Windows Store version. This did the trick for me: https://github.com/BroJenuel/Explorer-Context-Menu-Integration-for-windows-terminal – Blightbuster Jan 05 '21 at 20:07
  • @Blightbuster what’s the error? Or you just want to promote another approach? – Lex Li Jan 05 '21 at 23:22
  • I tried your answer which reported no error's but also didnt work. I assumed it was because of https://github.com/lextm/windowsterminal-shell/issues/43. Since I dont want to switch to another terminal deployment method I keept looking for other solutions. Would have posted it as an alternate aswer but unfortunately this question is closed (not sure why this is considered off-topic...). – Blightbuster Jan 05 '21 at 23:31
3

The Win-X Menu shortcuts are stored in %LOCALAPPDATA%\Microsoft\Windows\WinX and in the Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ShellCompatibility\InboxApp part of the registry, but the file explorer option is the one that really dictates what happens in the Win-X menu. I do not suggest just adding and changing stuff in the WinX folder because you could mess things up, however, the winaero.com/comment.php?comment.news.30 app in the link provides a way in which you wouldn't mess it up. Either way, you should put "%programfiles%\WindowsApps\Microsoft.WindowsTerminal_0.11.1121.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe" in either a shortcut in the WinX folder, or in the app named accordingly. Win-X Menu with Windows Terminal

Community
  • 1
  • 1
Nico Nekoru
  • 2,075
  • 1
  • 11
  • 30