Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a explorer context menu entry to let the user pick the profile they want to "open here" #6111

Open
zadjii-msft opened this issue May 21, 2020 · 4 comments
Labels
Area-ShellExtension For issues related to the explorer right-click context menu Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.

Comments

@zadjii-msft
Copy link
Member

zadjii-msft commented May 21, 2020

Follow up from #6100

We should add another entry to the explorer context menu to let the user select which profile.

This is the only other option I'm considering at this time, I don't want to clutter that UI too badly.

notes:

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 21, 2020
@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. labels May 21, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 21, 2020
@zadjii-msft zadjii-msft added this to the Terminal v2.0 milestone May 21, 2020
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label May 21, 2020
@zadjii-msft zadjii-msft added Area-ShellExtension For issues related to the explorer right-click context menu and removed Area-User Interface Issues pertaining to the user interface of the Console or Terminal labels May 28, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 28, 2020
@miniksa miniksa added Area-ShellExtension For issues related to the explorer right-click context menu and removed Area-ShellExtension For issues related to the explorer right-click context menu labels Jun 19, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 19, 2020
@tru0067
Copy link

tru0067 commented Dec 1, 2020

Hiya! This is an issue I found after creating my own personalized context menu for windows terminal using a registry edit.

It seems that the current implementation uses a different approach to populating the context menu, through a shell extension via appxmanifest. To me, an implementation involving directly adding registry keys directly through a .reg or .bat script seems to have several solid pros, namely:

  • Very easy to disable (by simply deleting the relevant registry keys), from the high number of duplicate issues requesting this feature it seems like this is something that people want to be able to do (see eg. Issue 8105).

  • Easily extensible, by simply adding/editing the existing keys users would be able to add their own start-up options, e.g:

    • Opening windows terminal with two tabs/splits running different shells in the relevant directory.

    • Opening windows terminal and running a command (e.g. starting a server, or opening the directory in a terminal based text editor), etc.

    • Setting certain context menu items to only appear on shift click (Issue 6113) by simply adding the "Extended"="" string-value to the key.

    The default keys would provide a useful template for such customized context menu items, and it would also allow for customized options to appear within any default cascading menus (eg. for multiple profiles, as mentioned in this issue).

  • There is already a strong precedent for terminals using registry keys for their context menus, namely PowerShell's "Open PowerShell window here".

Additionally, I do not think that this implementation would have to wait for the internal bug-fix mentioned in Issue 6414, though that may be a moot point as that may be resolved before any context menu changes go through.

Admittedly, I can see one flaw of such an implementation, newly added profiles may have very poor discoverability. A cascading menu listing all profiles may need to be manually refreshed - this seems like an option that could be quite accessible within the planned gui settings, but with the current settings.json it might be a hassle ( { "refreshContextMenu": true } ? ).

Similarly, deleted profiles may linger unwantedly - again something that might be easily addressed within gui settings in which profiles are removed by pressing a button, but with settings.json it would be tricky. Diffing for removed profiles doesn't seem like a good idea, and simply deleting all keys that do not match a profile may have the unwanted side effect of removing any of the user's custom added keys.

If this approach does seem to be beneficial it would be something I'd be interested in contributing to, though there may be some benefits to the current implementation that I am unaware of.

Thanks and kind regards!!

@kirsan31
Copy link

Very needed feature. I was thinking that after open from explorer context menu every new tab will preserve current dir, but no :(

@Flightkick
Copy link

Stumbled upon this project while searching this topic: https://github.com/lextm/windowsterminal-shell
I would rather see this kind of functionality included in Windows Terminal instead of being provided as a third-party PowerShell script. Though the idea is nice.
It looks like the linked project only checks the profiles during installation so changes after that won't change anything. A per-profile toggle would be nice to control which profiles to show in the context menu (just like there's a toggle now for which profiles to show in the dropdown within Windows Terminal).

@zadjii-msft
Copy link
Member Author

zadjii-msft commented Sep 20, 2022

Notes:

  • I don't know how to add nested menu entries to File Explorer. I'm not sure there's a sample of how to do it that's not older than I am.
  • I tried in dev/migrie/fhl/nested-file-explorer.
  • I'd love to just try this out without even using the settings model, as a test. Alas, I have no idea how.
    • Adding actual settings parsing might be hard. A dependency on WinRT would be hard.
  • I'm imagining two settings at the moment:
    • globals.allProfilesInContextMenu: when true, the context menu entry has all the non-hidden profiles listed as nested entries.
    • globals.runAsAdminInContextMenu: When true, we'll add a second entry for "(As Admin)". This entry will also obey the above one, switching between a single entry and a nested one.
  • John L from the shell team has a context menu samples repo in OS.Developer, internally. I put the relevant file in https://gist.github.com/zadjii-msft/fc6b2ba8fda66cf7cc37fa7a21cc731a, because idl if that's OSS or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-ShellExtension For issues related to the explorer right-click context menu Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

7 participants