wez / wezterm

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

Allow registering as default terminal app on Windows 11 #2416

Open ibay770 opened 2 years ago

ibay770 commented 2 years ago

The default app dialogue on Windows isn't cutting it so I was wondering if an option for Wezterm to handle the bat/cmd batch files could be made by default, on a double click instead of just a right click.

wez commented 2 years ago

If I understand correctly, you desire to have wezterm be the default console host when opening programs from gui programs that don't have their own console.

https://github.com/microsoft/terminal/blob/main/doc/specs/%23492%20-%20Default%20Terminal/spec.md documents the complex handoff required for that. At a high level, it sounds like wezterm-gui would need to be built so that COM activation is possible, implement a particular COM interface, and then register itself as a default terminal.

The spec doesn't specify the minimum version of Windows in which that is supported, but https://devblogs.microsoft.com/commandline/windows-terminal-as-your-default-command-line-experience/ suggests that Windows 11 is required.

I'm in no rush to install Windows 11 on my AMD system (heard too many stories about terrible performance), so I've no way to test this functionality in the foreseeable future.

KalleOlaviNiemitalo commented 1 year ago

As announced in https://github.com/microsoft/terminal/discussions/15505 and https://github.com/MicrosoftDocs/terminal/pull/680, changing the default terminal no longer requires Windows 11; the feature was released for Windows 10 22H2 in KB5026435 (OS Build 19045.3031)

atheeq-rhxn commented 3 months 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"')