You can use a commandline
field in your profile configuration to initiate an SSH connection on tab creation.
Step-by-step guide:
- Ensure you have an SSH client (try to connect to the server from a
Command Prompt
tab). @dhgouveia2’s post details this step. - Open Settings (Ctrl+,)
- Find the
"list"
array in the"profiles"
object - Find a
Command Prompt
profile ("commandline": "cmd.exe"
) - Duplicate the profile (copy-paste the whole object, watch for the comma between objects)
- Change the
"guid"
value to a new GUID (for example, from here) - Change the
commandline
value to"commandline" : "ssh me@my-server -p 22 -i ~/.ssh/id_rsa"
(use your own connection command). - Change the profile’s
"name"
- Add an
"icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png"
item to use a Tux icon (default icons are here) - You should have something like this:
{ "$schema": "https://aka.ms/terminal-profiles-schema", "profiles": { "list": [ // ... { "guid": "{1d43c510-93e8-4960-a18b-e432641e0930}", "name": "ssh my-server", "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png", "commandline": "ssh me@my-server -p 22 -i ~/.ssh/id_rsa" } ] } }
- Save the configuration and enjoy the new item in the New Tab drop-down.