Open 4 putty terminals at the 4 corners of the screen in Windows

4

1

I have a shortcut that opens a PuTTy terminal. When I click the shortcut 4 times (or once), can the PuTTy windows align in the 4 corners of the screen and fill 4 equal areas? How?

Tasos

Posted 2018-01-08T17:02:31.007

Reputation: 149

Answers

8

Windows and PuTTy don't have this as a default option. There might be automated screen organizing software out there, but I'm not aware of any (you can ask at http://softwarerecs.stackexchange.com).

What I would do is create an AutoHotKey script. Below is a very generic version of what you could do to launch 4 PuTTy windows and arrange them equally around the screen with a single shortcut:

SetTitleMatchMode, 2
SetTitleMatchMode Fast

Run, % "C:\Putty\Install\Folder\putty.exe"
WinWait putty
;Upper Left
WinMove, putty, , 0, 0, 960, 540

Run, % "C:\Putty\Install\Folder\putty.exe"
WinWait putty
;Upper Right
WinMove, putty, , 960, 0, 960, 540

Run, % "C:\Putty\Install\Folder\putty.exe"
WinWait putty
;Lower Left
WinMove, putty, , 0, 540, 960, 540

Run, % "C:\Putty\Install\Folder\putty.exe"
WinWait putty
;Lower Right
WinMove, putty, , 960, 540, 960, 540

This assumes that you have an HD screen (1920x1080). You can include site and login information to each window, so they will automatically start the connection you want for each one too. You'll just need to look up the PuTTy command line commands you need for the sites you are using and include them as part of the Run command for each window.

techturtle

Posted 2018-01-08T17:02:31.007

Reputation: 8 059

The script didn't work as expected, it opened 4 putty windows on top of each other. I also tried doing Run, % "C:\Putty\Install\Folder\putty.exe -load myprofile", with the same result. I ofc replaced Putty\Install\Folder with my Program Files\PuTTY. I'm on Windows 10 btw – Tasos – 2018-01-09T11:41:21.193

1I will admit that I didn't test this with PuTTY directly, since I don't have that installed on any computer where I use PuTTY. I have several scripts that do exactly what you described but with various apps, so I just modified it to fit for an example. It does work with a lot of windows, including command prompts, but some apps maintain too tight of control over their size and position for AHK to change it. – techturtle – 2018-01-09T13:10:29.167

3

This answer uses Snap Assist of Windows 10 and AutoHotKey.

Snap Assist can place and resize windows on half-screen or quarter-screen with the following Corner Snap hotkeys :

  • Win+Left , Win+Up : Left-upper quarter-screen
  • Win+Left , Win+Down : Left-lower quarter-screen
  • Win+Right , Win+Up : Right-upper quarter-screen
  • Win+Right , Win+Down : Right-lower quarter-screen

The following AutoHotKey script will place notepad on the left-upper quarter-screen and will resize it to the size of the quarter-screen:

SetTitleMatchMode, 2
SetTitleMatchMode Fast

Run, % "C:\Windows\System32\notepad.exe"
WinWait Notepad
Send {LWin down}{Left}{LWin up}{LWin down}{Up}{LWin up}

You should modify the script as follows :

  • The last 3 lines are to be replicated for each putty invocation
  • In the Run command, replace the path to notepad.exe by the path to putty.exe. The parameters to putty are added immediately after the program with a separating blank. If a parameter contains special characters, enclose it in double quotes.
  • In the WinWait command, the parameter should contain some identifying word or partial word on the window's title which is unique to that putty invocation
  • The keys on the Send command should be modified to specify the right quarter-screen. The other AutoHotKey key-codes to use are: {Down} and {Right}.

For this to work, Windows 10 Snap Assist should be enabled, which is its state by default. If it needs to be enabled, launch the Settings app from the Start Menu, click System, click Multitasking on the left, and set the Snap option. The following two options must be set to On :

image

harrymc

Posted 2018-01-08T17:02:31.007

Reputation: 306 093

0

You cannot do what you want just with PuTTY but you can use MTPuTTY (Multi-Tabbed PuTTY) http://ttyplus.com/multi-tabbed-putty/

See what it does here:

https://www.youtube.com/watch?v=nsgzxzSiifA

Pat

Posted 2018-01-08T17:02:31.007

Reputation: 2 593