Home » Uncategorized » PuTTY: Double-click select IPv6 addresses

PuTTY supports selecting words with a double-click, eg: an IPv4 address. By default this doesn’t work with IPv6 addresses because the “:” character is treated as a delimiter. You can fix this though! Documentation: http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter4.html#config-charclasses

In a nutshell:

1. Goto the Session’s settings -> Selection.
2. Scroll down to ‘:’ and change its class from ‘1’ to ‘2’.
3. Save settings

You should now see IPv4 and IPv6 addresses are both selectable with a double-click. :)

How do I get this everywhere?
You can save this tweak to your ‘Default Settings’ template, but that won’t fix all your existing sessions.
To fix those you’ll need to edit the registry.

Here’s a before and after diff showing what needs to change:

< "Wordness32"="0,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1" # before
---
> "Wordness32"="0,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1" # after

Here’s a batch file that’ll fix it all for you:

@echo off
echo "Fetching PuTTY sessions from registry..."
reg query HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions > sessions.txt
for /F "tokens=*" %%A in (sessions.txt) do (
 echo "%%A - Updating..."
 reg add %%A /v Wordness32 /t Reg_Sz /d "0,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1" /f
 echo "%%A - Done!"
)
echo "Done!"

Enjoy!