Putty – Fixing Right Click Paste

The Problem

When using PuTTY to copy and paste text, especially router configurations, it’a far too easy to make a ‘mis-click’ and paste the copied data into the configuration of a router. By default, any text selected in PuTTY is automatically copied to a buffer, ready for pasting. A simple right click can paste to the existing CLI and cause massive configuration errors.

I would think that everyone has done this at least once in their life, and it is a major risk and objection to using putty as a corporate tool.

The Data

There is an option in the PuTTY configuration modify the behaviour of the right click operation. Open the session window and select Window, Selection

putty-right-click-paste-2.jpg

By default the Right Button is configured to paste.

The Fix

putty-right-click-paste-1.jpg

Change the “Action of Mouse Buttons” to Right CLick brings up the menu.

The Test

putty-right-click-paste-3.jpg

Lets select some text.

putty-right-click-paste-4.jpg

Right Click †with the mouse now gives a menu of options. The effectively prevents the accidental paste that is so common.

Some Caveats

  • If you have existing session defined in PuTTY then you must select each one of those session and edit it for this action.
  • You should set the Global Default for all new sessions so that you only have to do this fix for your existing settings.
  • If you don’t understand how to create and manage sessions in PuTTY, then look at other posts in the “Working with Putty” series, listed below.

Other Posts in A Series On The Same Topic

  1. Putty - Fixing Right Click Paste (9th January 2011)
  2. Putty, the Command Line and NO clicky clicky (5th October 2009)
  3. Putty - Recommended Default Settings for a Network Engineer (21st September 2009)
  4. Setting the Defaults for PUTTY (20th September 2009)
About Greg Ferro

Greg Ferro is a Network Engineer/Architect, mostly focussed on Data Centre, Security Infrastructure, and recently Virtualization. He has over 20 years in IT, in wide range of employers working as a freelance consultant including Finance, Service Providers and Online Companies. He is CCIE#6920 and has a few ideas about the world, but not enough to really count.

He is a host on the Packet Pushers Podcast, blogger at EtherealMind.com and on Twitter @etherealmind and Google Plus

You can contact Greg via the site contact page.

  • Keith

    Good tip, I definitely have made this mistake before and I think I’ll change this setting when I get back to work on Monday.

    • http://etherealmind.com Greg Ferro

      Make sure you change all your existing sessions that you have configured as well as the global setting (which would be used for all future session).

      • Keith

        Definitely. Will do, thanks Greg.

  • Brannen

    Good tip – and I’ve made that mistake, fortunately I wasn’t in config mode. But after getting used to it, it’s a real time saver.

  • Andrew

    I must have something wrong with me.. I like the automatic selection and the right click pasting, and wish Gnome Terminal worked the same way.

  • http://blogg.kvistofta.nu Jimmy Larsson

    Strange. I¥v never seen right click paste as a problem. Actually its one of the best features of putty imho.

    If you accidently push buttons you should consider taking back control of your body. :-)

    /Jimmy

    • http://twitter.com/Telanis_ Telanis

      “Accidentally” is not the problem, it’s the completely unexpected action that’s inconsistent with the rest of the platform.  If you’ve gotten used to it and like it that’s great, but it sucks hard when you’ve selected text and are just trying to bring up a context menu.

  • Stu

    MANY MANY Thanks for your post! I’ve been battling with that for quite a while as the right-click and manu paste has become a habit that is hard to break. When working in equipment, this has indeed caused problems for me. I had to take a moment out from my work to see if there was a fix for this for Putty. Otherwise, Putty is an excellent tool and I am extremely grateful that the authors have shared it with all.

  • http://fontsbytes.com/ FONTSBYTES.COM

    why didn’t say what one needs to do to save that settings change? common man

  • Brad Stephens

    FYI, the keyboard shortcut to paste is shift+insert.

Subscribe For Weekly Updates by Email

Get a Weekly Summary of Latest Articles and Posts to your Email Inbox Every Sunday

Thanks for signing up. Look for the email from MailChimp & make sure you confirm your email address. You may need to check your spam or gmail settings to be sure of receiving the email.

Note: You can unsubscribe at any time using the link at the bottom of every email.