PuTTY is a free, cross-platform terminal program that supports SSH, telnet, and raw socket connections. For authentication it supports public key and kerberos single-sign-on. This application, is one of the oldest clients for Microsoft Windows, released by Simon Tatham in 1998. It’s a wonderful application that can be trusted to work when many others fail.

This post discusses some of PuTTY’s most useful features–text selection. When it comes to selecting text, everyone using a computer knows how to drag-and-drop. In fact, according to Yoni Heisler, Microsoft included the game solitaire in order to help teach users how to perform basic tasks on the computer including dragging and dropping. PuTTY, however, offers a few more choices than just the old-school drag-and-drop. There’s also double click, triple click, and block text selections. These tricks and more can also be found in the PuTTY User Manual.

Double Click/Word Selection

If you’re trying to select a single block of text (a.k.a. a word), PuTTY provides the following shortcut. Place your cursor anywhere in the word you want to highlight and double click. This will highlight the entire word, with a few exceptions. To achieve this effect PuTTy uses character classes for determining where a word begins and where the word ends. Any text classified as a 0 or 1 is not considered part of the word and PuTTY will end its highlighting upon reaching such a character. Any character of a class 2 will be included in the selection. The character classes are categorized as such:

  • Class 0 contains white space and control characters.
  • Class 1 contains most punctuation.
  • Class 2 contains letters, numbers and a few pieces of punctuation (the double quote [ ” ], minus sign [ – ], period [ . ], forward slash [ / ] and underscore [ _ ]).

Currently, PuTTy only covers ASCII characters, since the entire set of Unicode would be too much, having around 128,172 characters, depending on the version. That said, the classification of characters is not written in stone. Users can customize their character sets. Like any of PuTTY’s settings, the classifications can be customized at the granular level of the session or they can be set for all sessions. Follow these steps to change a character’s classification:

1.From the PuTTy configuration screen click on Selection.

putty configuration selection

2. Then on the right-hand side of the window, you’ll see the Character classes list.
3. Select the character you wish to change.
4. In the Set to class box below the list, enter the new class for the selected character.
5. Click the “Set” button.

By changing these settings a user can alter any character, and thereby change how PuTTY highlights words on double click. The most common and useful character to change is the ampersat, or ‘at sign’ (@). By changing the ampersat from its default class of 1 to 2 you can prevent PuTTY from only highlighting text up to the at symbol ‘@’. This would allow you to double click on an email address and highlight the entire address, instead of only getting the text before or after the ampersat (@).

Triple Click/Line Selection

If you double-click a word and then drag across other lines of text, PuTTY will begin highlight entire lines starting from the word you first selected. But, what if selecting the entire line is exactly what you need? PuTTY has a trick for that too. By placing your cursor anywhere on the line to be highlighted and triple clicking, you’ll select the entire line. If you hold the final click and drag across other lines of text, you’ll select each of those lines in their entirety.

Block Selection

Now let’s say you need to highlight a vertical section of text, but you don’t want to capture the entire lines–PuTTY has a neat trick for that too. For this trick, you’ll place your cursor at the top left of the first word you want highlighted. Then, while holding the alt key drag diagonally down across the vertical section of text you want. This action will select the block of text as demonstrated in the picture below.

block selection text

The best part of all of this is that once you highlight text in PuTTY, it’s already copied to your clipboard and ready to be pasted elsewhere. If you want to paste the text within PuTTY, just right click–boom, all done!

Share This