-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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 protocol handler to open new tab in existing Windows Terminal #9061
Comments
@j4james very interesting, it looks like the other issue is very similar to this one, with the exception of the protocol handler. I wouldn't mark it as duplicate, because the protocol handler would be usable to open a new tab from a browser-based password manager (we have those as well), but then the requirements are different, and we'd have to see how to properly handle security for the dynamic command injection. I suggest we modify this feature request to be the protocol handler built on top of the other issue #8898, rather than the entire feature by itself. The goal would be to securely expose the same functionality but through a protocol handler instead. I have a few ideas how security could be handled:
What do you think? |
This is what @zadjii-msft is recently working on. |
Got a link to a branch or related issue with the WIP code? 😲 |
There’s a bunch of related issues. For PR there’s #8898 , which may not be exact what you asked by is part of a grand plan. |
Oh sorry about it. Didn’t noticed James already mentioned #8898. I was merely want to summon @zadjii-msft. Bet he has something to say about this issue. |
Hey thanks for the great write up here. I think for the majority of cases, the We've actually already started the discussion of a protocol handler over in #4842, so I'm gonna close this discussion as a dupe. I am going to make sure to call this thread out though, because it's got some great points. Thanks! /dup #4842 |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Description of the new feature/enhancement
Add a protocol handler (winterm://) to allow opening a new tab inside the existing Windows Terminal, instead of opening a new Windows Terminal. The current "Open in Windows Terminal" contextual menu option unfortunately always open a new Windows Terminal, instead of adding a new tab to the current one. The goal is to make it easier for third-party programs to implement richer "Open in Windows Terminal" functionality, where a new tab with a special profile is opened with an initial command injected. In our case, we intend to launch PowerShell remoting sessions from Remote Desktop Manager inside Windows Terminal. We currently supported embedded tabs inside Remote Desktop Manager, or we can launch the old boring blue PowerShell terminal externally. Since the old PowerShell terminal doesn't support tabs anyway, it has never been an issue.
Proposed technical implementation details
Regardless of the final name for the protocol handler (I suggest winterm://) the implementation is relatively simple: on startup, you check for the presence of an existing Windows Terminal instance. If there is one, you send the URL string passed through the protocol handler to the other process, and terminate. The receiving instance receives the URL and processes it to open a new tab with the specified profile id. We have implemented something like this to open new connections in our remote desktop program.
the URL string should contain at a bare minimum a profile id, and accept additional parameters following the same format found in settings.json:
winterm://34a13805-9b56-5e89-9234-f02de44bd971?name=Name?command=Command
Since addition parameters like the name and the command will likely contain characters causing trouble, I suggest that we either URL-encode them, or define them to always be encoded as UTF-8 base64url strings, whichever feels best.
The ideal solution would be to support temporary profiles, such that if the profile id doesn't exist, it could be created on-the-fly with all the parameters passed. This would be very useful as external programs could inject meaningful names, and even give a path to an icon file to use. In our case, system administrators can manage thousands of entries in Remote Desktop Manager, so everything that makes it easier to give identifying or distinctive information is a big win.
If we can have such a mechanism in place, we have everything we need for a possible integration, and nothing prevents other vendors from offering similar integration with relatively little effort. The good news is that it would also be relatively decoupled from Windows Terminal.
The text was updated successfully, but these errors were encountered: