Semi-dynamic Templates for Putty

One of the missing features of Putty is templates.
I've been doing some work outside and in sunlight the usual terminal colors, black background and white letters just don't work. So I had to change the settings for a couple of my sessions.

I'd been wondering a while about templates in Putty so I wrote a simple script that allows to keep your own common settings in Templates registry key. Putty has it's setting in HKCU:\Software\SimonTatham\PuTTY and all the session settings are in Sessions-key.

This script searches for all Sessions and if it finds property TemplateName it applies templates found in that property from key HKCU:\Software\SimonTatham\PuTTY\Templates. TemplateName can have more than one template name, the template names are comma-separated and applied in that order listed.

Templates can have parent templates. It as also possible to create subkeys in Templates key if you want to create your own set of templates and import that key to another computers without messing templates in there. Then the tempalate name would be like Marko/Summer.

If you import templates from others keep in mind there is no security. Everything that is in that template overwrites those properties in your session. So you should always know what settings these templates change.

When you want to apply the templates to sessions, you simply run script ApplyPuttyTemplates.ps1. The script copies all the properties found in templates over the sessions properties. (=Take a backup before you start playing with this )

There are example templates in file PuttyTemplates.reg.
Root-template has the settings you want to your every session.
Winter and Summer - templates change the screen colors and have Root template as a parent template.
Then there is a separate Season - template that has Winter or Summer as a parent template so you can quickly change Winter/Summer all the sessions that use Season template.

You can also create templates like Production, Testing that have different fonts or colors and apply those those templates after the Season template is applied (for instance  TemplateName=Season,ServerType/Production ).


It's not perfect, it's not polished. It's working and I can quickly apply new templates to my sessions.


The source code for my scripts is in GitHub
https://github.com/MarkoMarjamaa/PuttyTemplates

Comments