Is there a way to force putty to allow to paste with right-click, on Zorin OS (Ubuntu based).

I like the windows behaviour, where selected stuff is pasted, when right click is pressed.

  • 1
    out of curiosity, why in the world would you use putty if you're not on Windows?
    – terdon
    Feb 22, 2020 at 14:00
  • 1
    Putty also supports serial, telnet and some other stuff all in one program. I have posted a relevant answer if the reason you're using putty is not for SSH. Feb 24, 2020 at 16:08
  • I use putty because I'm used to it and I like it's interface and behavior on Windows. It's linux...must there be something I can do to make it to work like I want, regardless of putty supporting it or not. I use a laptop and I can't just use the "middle button"...
    – Freedo
    Feb 26, 2020 at 1:11

6 Answers 6


As user @ateijelo said in their answer it's not possible to use "Compromise (Middle extends, Right pastes)" on Unix because it's not implemented. I don't know why isn't it, you should ask Putty developers about that, most probably nobody has even requested it. But, thanks to the nature of open source you can always modify the program's source code to suit your needs and use it. The following patch will modify the default behavior of right click and will make it paste the text:

diff --git a/unix/gtkwin.c b/unix/gtkwin.c
index 5660ee9..4f2ec2b 100644
--- a/unix/gtkwin.c
+++ b/unix/gtkwin.c
@@ -447,7 +447,7 @@ static Mouse_Button translate_button(Mouse_Button button)
     if (button == MBT_MIDDLE)
         return MBT_PASTE;
     if (button == MBT_RIGHT)
-        return MBT_EXTEND;
+        return MBT_PASTE;
     return 0;                          /* shouldn't happen */

diff --git a/unix/uxsftpserver.c b/unix/uxsftpserver.c
index a90344e..6fab0ba 100644
--- a/unix/uxsftpserver.c
+++ b/unix/uxsftpserver.c
@@ -412,16 +412,6 @@ static void uss_fstat(SftpServer *srv, SftpReplyBuilder *reply,

-static inline int futimes(int fd, const struct timeval tv[2])
-    /* If the OS doesn't support futimes(3) then we have to pretend it
-     * always returns failure */
-    errno = EINVAL;
-    return -1;
  * The guts of setstat and fsetstat, macroised so that they can call
  * fchown(fd,...) or chown(path,...) depending on parameters.

You have to get Putty source code, apply the patch and re-build Putty. It's a simple process though.

Clone Putty repository:

git clone git://git.tartarus.org/simon/putty.git && cd putty

Save the patch I pasted above to MBT_PASTE.patch and apply it (if it fails download patch directly from http://drabczyk.org/MTB_PASTE.patch):

git apply MTB_PASTE.patch

Build Putty:

$ cd unix
$ ../mkfiles.pl  && ../mkauto.sh
$ make -j$(nproc) -f Makefile.gtk LDFLAGS="-Wl,--no-as-needed,-ldl"

Building takes only 6 seconds on my machine. Start the newly built Putty binary:


You should see all of your saved sessions and settings just as if you stared Putty installed system-wide using your distro's package manager. You should now be able to paste selected text with right click. If you don't want to recompile Putty on your own and you trust me you can get a precompiled binary from here http://drabczyk.org/putty.

This method has its disadvantages of course. The change I've introduced has not formally accepted by Putty developers what means you're now using a fork. If you replace Putty binary installed with your distro's package manager with this it will be replaced each time you update Putty using your distro's package manager (and sometimes you may not even realize that Putty is being updated, for example when running a massive system upgrade). Alternatively, you can put your fork of Putty elsewhere, for example in ~/bin and prepend ~/bin to your $PATH so that the fork will be picked before system-wide Putty binary. I also don't know which unwanted side effects can this small change cause, if any.

I was also thinking about using xdotool but I'm not sure if you run X or Wayland and I think that modifying a single line in the source code is all in all easier.

  • I'm getting error: corrupt patch at line 13 when trying your patch. I copied and pasted using vi...
    – Freedo
    Feb 26, 2020 at 18:31
  • Sorry, I can't paste it correctly here. Get it from drabczyk.org/MTB_PASTE.patch Feb 26, 2020 at 18:40
  • Still having the same issue idk how
    – Freedo
    Feb 26, 2020 at 18:54
  • 1
    If you're using a Debian based system (you mentioned apt install), then do apt-get source putty, make your changes and then do dpkg-buildpackage --no-sign the source directory. That should take care of all the dependencies and compilation steps and give you a nice .deb file in the parent directory.
    – ateijelo
    Feb 26, 2020 at 21:27
  • 1
    @undercatapplaudsMonica: it causes ../unix/uxsftpserver.c:416:19: error: static declaration of 'futimes' follows non-static declaration, both on my host Slackware 14.2 system with glibc 2.23 and in official Ubuntu docker image with glibc 2.27. I guess there is a bug somewhere in the build system. Feb 27, 2020 at 11:27

Hold CTRL + right click into putty window will allow you to select "Paste from CLIPBOARD" or "Copy to CLIPBOARD" from a menu. Close enough?

  • So simple and easy ! :)
    – alireza
    Jan 4, 2023 at 8:20

The MS-Windows/dos/cmd terminal has the feature of paste-last-selection bound to right click (if enabled). Putty may be doing the same.

Many X11 programs have this bound to the middle click. However no need to select the selection with the additional click. This will work with openssh.

While I have no idea why anyone would use PuTTY outside of Microsoft's Windows (It is an ssh for MS-Windows to help people escape, and not as good as open-ssh-client in konsole ). I have confirmed that the middle-click does paste into the PuTTY terminal on Debian 10:

Putty Release 0.70
Build platform: 64-bit Unix (GTK + X11)
Compiler: gcc 8.3.0
Compiled against GTK version 3.24.5
Source commit: 3cd10509a51edf5a21cdc80aabf7e6a934522d47
  • I recommend konsole + openssh-client (ssh). Feb 21, 2020 at 10:19

Ok, based on the answer by @arkadiusz-drabczyk, I'll flesh out how to make your own version of PuTTY on Debian:

Enable source URIs in your apt source files. This can be done with UIs in many distros:

enter image description here

or by making sure you have lines in /etc/apt/sources.list that look like this:

deb-src http://deb.debian.org/debian/ stable main contrib non-free

Once you have those, follow these steps:

mkdir putty
cd putty
sudo apt-get update
sudo apt-get install wget
sudo apt-get build-dep putty
apt-get source putty
cd putty-0.70
sed -i 's/return MBT_EXTEND/return MBT_PASTE/' unix/gtkwin.c
dpkg-buildpackage -b --no-sign
cd ..
sudo dpkg -i putty_0.70-6_amd64.deb putty-tools_0.70-6_amd64.deb

Check where it says 0.70 and change for the right version for you. This should get your modified PuTTy installed.


While I don't know how to force putty to use the right-click on Linux, I suggest (like other answers) using a better program if at all possible.

Everyone here has assumed you're using putty for SSH, if that's the case I would recommend using your standard terminal and the SSH program.

If however you're using a serial interface I would recommend using the screen terminal emulator instead. For example I launch it like this sudo --group dialout screen /dev/ttyUSB0 115200 to interact with our serial devices. With this approach you only get the immediate window though, if you need to access the scrollback you'll have to use the hotkey Ctrl+a, [ then you can use your arrow keys to navigate the history. Simply press Esc to exit copy mode and return to the current line.

Using your standard terminal allows you to copy and paste as your would with any other terminal program via the right click or hotkeys if supported by your terminal. With screen you also get a whole bunch of features that may/not be useful depending on what you need to do.

For Telnet and the other communications that putty supports I'm sure Linux has plenty of similar alternatives available.

If this doesn't cover your use case I suggest modifying your question to actually let us know what you're doing with putty so we can best advise.

  • 1
    Don't run as root (sudo without --group). There is no need to and it is dangerous. Instead: become a member of the dialout group, serial ports are usually in this group; or add the serial port to a group, that you are a member of. Feb 24, 2020 at 17:34
  • Given that this is just my PC, and that I know that screen to a USB shouldn't effect the system it doesn't really matter that much for me... But I take your point and I didn't know about the --group option so that's good to know for future. I'm happy to keep the edit as it is good advice for security! Feb 25, 2020 at 14:09

I don't bring good news. The docs say this:

Windows often only has two mouse buttons, so when run on Windows, PuTTY is configurable. In PuTTY's default configuration (‘Compromise’), the right button pastes, and the middle button (if you have one) extends a selection.

If you have a three-button mouse and you are already used to the xterm arrangement, you can select it using the ‘Action of mouse buttons’ control.

and indeed, the config has an additional section:

enter image description here

And even if you set the MouseIsXterm=1 option in the config file of a saved session, PuTTY only pays attention to it when running in Windows. Search for mouse_is_xterm in the source file windows.c.

If you're using Linux frequently, I recommend to train your muscle memory to middle button paste, and when you use PuTTY in Windows, do the same. It's the standard in all Linux terminals, and you'll be fighting an uphill battle if you try to change it. Some terminals may allow it, but most won't.

  • It's linux. Must be a way to trick the system to do the behavior I and millions of people want. I use a laptop and it's not easy to just use a "middle button"
    – Freedo
    Feb 26, 2020 at 0:58
  • @Freedo not an answer to your question - but I just use the keyboard binding (shift+ins) when working on systems with only two mouse buttons available.
    – user234931
    Feb 26, 2020 at 12:40
  • @Freedo: you can also try to modify Putty's source code and re-compile it as a last resort Feb 26, 2020 at 15:52
  • XTerm at least permits changine the mapping - but beware ... mouse mapping via Xdefaults demands a bit of perseverance. Feb 26, 2020 at 19:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .