Saturday, November 18, 2017

PuTTY Copy On Right-Click

PuTTY is one of those tools that everyone seems to know a little something about. In general, I prefer to just work from a Linux based desktop, but all too often I find myself back on a Windows box needing to ssh somewhere. PuTTY becomes a good tool for this because you can download the standalone executable and just use it.

I recall a time many, many moons ago, when I was making an attempt to transition from primarily Windows on the desktop to primarily Linux on the desktop. One of the features I sought after for some time was a way to paste on right-click in the terminal, just like PuTTY. Oh familiar PuTTY.

If you tried to configure my Linux desktop that way today, I'd probably slap you silly. That is by far the most annoying, and incidentally the most dangerous feature of PuTTY.

"SURE! Just paste whatever happens to be in the clip board into that terminal window! It's cool. I'm sure it's not actually a command, and you're probably not logged into a production server anyways. Right?"

I use Linux at home these days, but when I go to work, they want me on a Windows box. Okay. PuTTY it is. But I'm turning off that goddamned paste feature! Here's how you can do it.

In the PuTTY Configuration screen, in the left menu tree, select Window -> Selection.


By default it is set to "Compromise (Middle extends, Right pastes)." These days I vastly prefer "Windows (Middle extends, Right brings up menu)."

This basically does what it says on the tin. When you highlight something, it will still automatically put that data in the clip board, but now when you right-click, it will bring up a context menu. In that context menu, Paste will be an option.

Boom. Your days of accidentally pasting awkward bits of emails into production command prompts are now over. Make sure you save this as the Default Settings session so that you don't need to change it with each new session you create.

Lots of love to the folk(s?) who maintain the PuTTY tools. To me, these tools are basically the gold standard by which all other such tools in Windows are judged.

No comments:

Post a Comment