wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
16.74k stars 752 forks source link

Bring "Open Wezterm Here" menu item on Windows 11 context menu #3777

Open blue-devil opened 1 year ago

blue-devil commented 1 year ago

Describe the solution you'd like Windows 11 brings a new context menu and if you want you can switch to old Windows 11 context menu. On new windows 11 context menu Windows Terminal comes by default. But after installing Wezterm, Open Wezterm Here context menu item only appears in old win10 context menu.

Here is a gif:

win11weztermcntxmn

Is there a way to bring wezterm to Win11 context menu. Can you make it default when we install wezterm.

Thank you.

blue-devil commented 1 year ago

Anyone can bring old windows 10 menu by using this by using this reg file:

https://gitlab.com/-/snippets/2547911

But I do not want that. I want wezterm menu item on windows 11 context menu. Thank you.

wez commented 1 year ago

If you (or someone else) can find out what APIs and/or registry stuff is needed to make it show up there, then that gives us a starting point for this.

blue-devil commented 1 year ago

In my next free time, I will look for this 👍

cmattinson commented 1 year ago

After doing some digging, it seems an app must either be packaged in the MSIX format, or granted identity (1) via other methods to appear on the condensed Windows 11 context menu. I was able to easily bundle the existing WezTerm installer (2) as an MSIX package with the MSIX Packaging Tool (3) as a test, but I believe to appear on the context menu it needs to implement a shell extension as the registry is virtualized for MSIX apps.

If you package your Windows app using MSIX, the registry is virtualized, and therefore your app can't register File Explorer extensions via the registry. (4)

Either packaging method would likely require a shell extension implementation for anything other than a file type association. Definitely not a trivial task just to save one button click!

(1) Grant package identity to non (MSIX) packaged apps (2) Create an MSIX package from any desktop installer (3) MSIX Packaging Tool (4) Integrate with File Explorer

wez commented 1 year ago

If a COM shell extension is required for this, it seems like it would make sense to also consider registering as a default terminal at the same time, which AFAIU, also requires a COM shell extension:

modz2014 commented 3 months ago

im willing to create if people are still interested in this if you like @wez

wez commented 3 months ago

@modz2014 I would love to see a PR for this, yes!

modz2014 commented 3 months ago

@wez I will work on this also for the msix package you will need to get it signed I can make an external package spare package or msix package with the full software in it If you would like to chat about it please DM on Discord modz2014#4684

wez commented 3 months ago

I'd prefer that the solution to this gets deployed as part of the existing iss installer. re: code signing, we don't have that in place yet. Maybe https://github.com/Azure/trusted-signing-action/issues/10 will have a path for that.

modz2014 commented 3 months ago

@wez possibly but this section will be yours as its your project also if you create the full msix package and upload it to the Microsoft store they sign it for us

modz2014 commented 3 months ago

@wez here is an example for i just created now but I need to create a msix package project in visual studio or I can make a batch script to build the msix package and sign it for testing it image

modz2014 commented 3 months ago

@wez i have made it in C++ is that ok no

atheeq-rhxn commented 1 month ago

https://github.com/user-attachments/assets/a70ce01e-ecf3-46ed-a0ca-343541f1ef81

https://github.com/user-attachments/assets/568408da-bc61-4bd2-9a15-879f77b5f2e3

To have these in you explorer follow the below steps:

  1. Install nilsoft shell
  2. Run it as administrator
  3. Click Register
  4. Shift + Right click in taskbar
  5. shell > config
  6. Before the lastline (i.e. import/taskbar) insert the below code snippet

item(title="nvim" tip=tip_run_admin admin=has_admin cmd='wezterm.exe' args='start --cwd "@sel.dir" nvim')

item(title="wezterm" tip=tip_run_admin admin=has_admin cmd='wezterm.exe' args='start --cwd "@sel.dir"')

  1. Save the file
  2. Shift + Right click taskbar
  3. shell > manager
  4. Click Restart Explorer

If you need logo like mine and the below logos in "~ \documents\logo\' nvim wezterm

Change the code to

item(title="nvim" tip=tip_run_admin admin=has_admin image="C:\\Users\\{Username}\\Documents\\logo\\nvim.png" cmd='wezterm.exe' args='start --cwd "@sel.dir" nvim')

item(title="wezterm" tip=tip_run_admin admin=has_admin image="C:\\Users\\{Username}\\Documents\\logo\\wezterm.png" cmd='wezterm.exe' args='start --cwd "@sel.dir"')