-1

Is there a way on Windows 10 to open multiple SSH connections in a predefined window layout? I have been using MTPutty for this, and it works well, except that I have to configure the layout every time manually.

Ideally I could be able to login and run a command automatically in each connection, but my main problem is having to manually define the layout each time.

I have found many threads on this and other sites that are concerned with preserving SSH sessions. This is not what I want, I think. I'm fine with logging in to each window, I just need them automatically arranged in predefined positions.

enter image description here

frnhr
  • 125
  • 8

1 Answers1

0

I think this is a question of taste. Personally I use the (awesome) windows terminal application.

When you open up Windows Terminal, by default it will open up a single tab with a single pane, using your default profile. However, if you wish to customize this start-up layout, you can use the wt command with command line arguments.

Installing Windows Terminal adds wt to the system path, so you can invoke it without having to specify the path. On it's own, wt will start up just a new instance of Windows Terminal, but it also has sub-commands for split-pane and new-tab, which allow you to set up the layout how you like.

The split-pane and new-tab commands both take a -p parameter which allows you to specify the the type of profile you want to open, referenced either by name or guid (you can find these in the settings.json file), and a -d parameter if you want to override the starting directory. Additionally, for split-pane you can specify -H or -V to split the pane horizontally or vertically.

You can use a ; in the command to string multiple sub-commands together. For example:

wt ; new-tab -p "SSH" ; split-pane -p "Ubuntu" -V; split-pane -p "SSH" -H -d "/home/myuser"
bjoster
  • 4,805
  • 5
  • 25
  • 33
  • I ended up launching `wt` from an AutioIt script and sending it some keystrokes to split panes as needed. Not perfect solution, I was hoping to something more robust and configurable, but it works fine for my purposes. Thanks. – frnhr Aug 20 '20 at 13:00