SSH handler #9238

Closed
opened 2026-01-31 01:49:25 +00:00 by claunia · 5 comments
Owner

Originally created by @trajano on GitHub (Jun 24, 2020).

Description of the new feature/enhancement

I'd like to do something like

WinR wt admin@myserver.com Enter

and it will start up or open an new tab in an existing Windows Terminal that will perform an SSH connection.

Proposed technical implementation details (optional)

Note this request is NOT to embed SSH itself to Windows Terminal, but provide some sort of generic handler for command lines with a username@host pattern along with ://@:/ pattern the protocol and ports should be defaultable (in my case if I had the configuration I would default to ssh since I generally work with that.

I was thinking it will be a profile that if not hidden will ask for a URL if selected and the "command" allows for extra fields that would be used to pass in the components

{
    "defaultUriProtocol": "ssh",

    "defaultUriProtocolHandlers":
    {
       "ssh": "{00000000-0000-0000-ba54-000000000001}"
    },

    "profiles":
    [

        {
            "guid": "{00000000-0000-0000-ba54-000000000001}",
            "commandline" : "%UserProfile%/scoop/apps/git/current/usr/bin/ssh.exe -p ${uri.port} ${uri.user}@${uri.host}",
            "startingDirectory": "%UserProfile%",
            "background": "#000000",            
            "fontFace": "Source Code Pro",
            "icon" : "c:\\opt\\icons8-console-96.png",
            "backgroundImage": "C:\\Users\\trajano\\OneDrive\\app-background\\terminal.png",
            "backgroundImageOpacity": 0.1,
            "name" : "SSH",
            "handlesUriProtocol" : "ssh"
        },

Note I used uri. to prefix it so we don't pollute the default namespace.

Originally created by @trajano on GitHub (Jun 24, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement I'd like to do something like <kbd>Win</kbd><kbd>R</kbd> `wt admin@myserver.com` <kbd>Enter</kbd> and it will start up or open an new tab in an existing Windows Terminal that will perform an SSH connection. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. --> Note this request is NOT to embed SSH itself to Windows Terminal, but provide some sort of generic handler for command lines with a username@host pattern along with <proto>://<username>@<host>:<port>/<path> pattern the protocol and ports should be defaultable (in my case if I had the configuration I would default to `ssh` since I generally work with that. I was thinking it will be a `profile` that if not hidden will ask for a URL if selected and the "command" allows for extra fields that would be used to pass in the components ```json { "defaultUriProtocol": "ssh", "defaultUriProtocolHandlers": { "ssh": "{00000000-0000-0000-ba54-000000000001}" }, "profiles": [ { "guid": "{00000000-0000-0000-ba54-000000000001}", "commandline" : "%UserProfile%/scoop/apps/git/current/usr/bin/ssh.exe -p ${uri.port} ${uri.user}@${uri.host}", "startingDirectory": "%UserProfile%", "background": "#000000", "fontFace": "Source Code Pro", "icon" : "c:\\opt\\icons8-console-96.png", "backgroundImage": "C:\\Users\\trajano\\OneDrive\\app-background\\terminal.png", "backgroundImageOpacity": 0.1, "name" : "SSH", "handlesUriProtocol" : "ssh" }, ``` Note I used `uri.` to prefix it so we don't pollute the default namespace.
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 01:49:25 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jun 24, 2020):

I mean it seems a lot easier to just do win+rwt ssh admin@server.comenter then hook all that up, right? That'll just run your default profile with the commandline of ssh admin@server.com, instead of whatever the commandline is set to

@zadjii-msft commented on GitHub (Jun 24, 2020): I mean it seems a _lot_ easier to just do <kbd>win+r</kbd>`wt ssh admin@server.com`<kbd>enter</kbd> then hook all that up, right? That'll just run your default profile with the commandline of `ssh admin@server.com`, instead of whatever the `commandline` is set to
Author
Owner

@trajano commented on GitHub (Jun 24, 2020):

@zadjii-msft except it seems less seamless

If Terminal had this capability then it can probably register itself as a protocol handler for Windows as well so if we click on a link that looks like ssh://me@foo.com it will start up terminal

@trajano commented on GitHub (Jun 24, 2020): @zadjii-msft except it seems less seamless If Terminal had this capability then it can probably register itself as a protocol handler for Windows as well so if we click on a link that looks like ssh://me@foo.com it will start up terminal
Author
Owner

@vbyrd commented on GitHub (Jun 24, 2020):

I created a small launcher script and protocol registry entries to do exactly this.

https://github.com/vbyrd/windows-terminal-ssh-protocol-handler

@vbyrd commented on GitHub (Jun 24, 2020): I created a small launcher script and protocol registry entries to do exactly this. https://github.com/vbyrd/windows-terminal-ssh-protocol-handler
Author
Owner

@DHowett commented on GitHub (Jun 25, 2020):

Thanks @vbyrd! Yeah -- in general, I think this is something the community is better-equipped to handle than us. Registering a protocol handler, especially by default like that, is something that I'd like the user to explicitly opt into.

At the same time, I'm not liable to put too many ssh-specific features into Terminal itself. If anything, it would be part of the extension that /dup #1280 turns into.

@DHowett commented on GitHub (Jun 25, 2020): Thanks @vbyrd! Yeah -- in general, I think this is something the community is better-equipped to handle than us. Registering a protocol handler, especially by default like that, is something that I'd like the user to explicitly opt into. At the same time, I'm not liable to put too many ssh-specific features into Terminal itself. If anything, it would be part of the extension that /dup #1280 turns into.
Author
Owner

@ghost commented on GitHub (Jun 25, 2020):

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!

@ghost commented on GitHub (Jun 25, 2020): 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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9238