Right click to paste in terminal

In gnome-terminal (and in Ubuntu in general) select text means "copy" (or "X selection" if you want to get technical, which is different from "clipboard copy"), which can be pasted via middle mouse click.


I found this patch by Tomi Valkeinen: Gnome-terminal patch for putty-like right mouse button paste

Let us know if it works for you.

Edit: I went ahead and checked it myself. It works perfectly. Here are the patched deb files for gnome-terminal-3.6.2: uploaded in mediafire

If you are using the same version of gnome-terminal, you can download the deb files and install it by:

cd /path/to/download/folder
sudo dpkg -i gnome-terminal_3.6.2-0ubuntu1_amd64.deb gnome-terminal-data_3.6.2-0ubuntu1_all.deb

Edit: For future reference, here is the full procedure:

Download the patch: right-button-paste.patch

Install build dependencies:

sudo apt-get build-dep gnome-terminal

Download the sources and apply the patch:

mkdir gnome-terminal
cd gnome-terminal
sudo apt-get source gnome-terminal
cd gnome-terminal-*
patch -p1 < path/to/right-button-paste.patch

Build and install:

sudo dpkg-buildpackage -us -uc -b
cd ..
dpkg -i *.deb

Up to date patches are maintained by Tomi Valkeinen at https://github.com/tomba/gnome-terminal under 'paste-*' branches.


Let me expand on my original answer a little bit. Technically, the default terminal emulator, the gnome-terminal does not have this functionality and there's no way to set it as far as I know or have seen from researching online. Therefore the answer to your question

Can I set Ubuntu's default terminal to do the same?

is basically, no.

On the other hand, putty is actually also available for Ubuntu, and that is the simplest , least-effort solution if you want a specific behavior. Do sudo apt-get install putty to get it.

There is however a few compromises that you can adopt, and they exist the way they are for historical reasons. The graphical environment under Unix/Linux X server has something known as selections, think of them as multiple clipboards - primary, secondary, and "clipboard". The second selection is when you highlight text and use ShiftInsert or middle mouse click to paste. Middle mouse click is scroll wheel click on mouses, and on touchpads - right and left click pressed together.

There are solutions with other terminals but since you request gnome-terminal specifically, the answer still remains , no, there's no other way.