PUTTY: How do I cut & paste under Ubuntu?

3

2

How does (where is) the the cut&paste function for PUTTY under Ubuntu ?

EDIT: source text is not in the PUTTY window.

EDIT: Found the problem: the source text is in a Google Chrome tab which does not support "cutting" (at least for now).

EDIT: mea culpa: I realize now that SSH is preferred under Linux.

jldupont

Posted 2009-09-22T19:19:27.177

Reputation: 5 524

1PUTTY on Linux? Why – Shiplu Mokaddim – 2011-12-21T12:16:45.293

Your third edit doesn't make sense either: Putty is SSH (most often), the point of the comments was that there are superior terminals under Linux. – Benjamin Bannier – 2012-01-26T00:13:50.597

Are you trying to "cut" or "copy"? Important difference. Is the text you're trying to select in a text box or displayed on a page (i.e. static text)? – Travis Northcutt – 2009-09-22T20:08:09.417

3Why would anyone use putty on Linux? – innaM – 2009-09-22T20:23:00.153

This question doesn't make sense. PUTTY on Linux? ssh under gnome-terminal, yakuake, tilda... all vastly superior. – The How-To Geek – 2009-09-22T20:31:29.167

My answer to why: as a serial console. I think it is better than screen/minicom for this. – anr78 – 2013-06-19T07:32:48.777

Answers

3

You can use the right mouse button to copy it, then click the middle mouse button (wheel) to paste.

John T

Posted 2009-09-22T19:19:27.177

Reputation: 149 037

1But what about 'cutting' text from another window? – jldupont – 2009-09-22T19:29:39.417

copy it from another window, then use middle mouse button on the putty window. – John T – 2009-09-22T19:37:58.277

@John T: does not work for me. – jldupont – 2009-09-22T19:39:12.737

Weird, does for me: http://i38.tinypic.com/2zscsvn.png

– John T – 2009-09-22T19:41:44.777

@John T : the issue is with Google Chrome... – jldupont – 2009-09-22T19:57:29.143

Have you tried copying instead of cutting? When dealing with putty it will use the X clipboard. You can compare the 2 by copying text from the browser, and opening the command line and typing echo TEXT | xclip. If you try to paste in an editor, the right-click paste will hold text from the browser, while the middle mouse will hold text that was piped to xclip. – John T – 2009-09-22T20:04:23.043

2

I solved this issue using 2 methods:

1. Using PuTTY Linux version:

Clicking both touchpad buttons, I simulated the middle button.

I needed to enable it manually, since the Linux Mint distro I'm using had not this middle button simulation activated. The latest version of evdev, version 2.5, changed the default for the middle mouse button emulation code. This change has disabled emulation of the middle mouse button by clicking the left and right mouse buttons.

To enable the middle mouse button emulation, add this to xorg.conf:

Section "InputClass"
Identifier "middle button emulation class"
MatchIsPointer "on"
Option "Emulate3Buttons" "on"
EndSection

2. Using PuTTY Windows version

I prefer that since I do not need to change distro settings like Xorg, only Wine settings in order to connect to console serial ports:

Since Wine handles com ports by having a link to the device (i.e. /dev/ttyUSB0), in the ~/.wine/dosdevices folder, this link would be created as follows, in order to update your wine profile configs:

ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1

I prefer this second method. Since copying and pasting always works, I do not need the middle button simulation and, the cherry on top of the cake, it NEVER hangs (occasionally PuTTY hangs on some Windows XP installations).

Otherwise, in case you do not need/want to install Wine, the first method is preferable.

Joao

Posted 2009-09-22T19:19:27.177

Reputation: 21

1

I replaced all occurences of GDK_SELECTION_PRIMARY with GDK_SELECTION_CLIPBOARD in unix/gtkwin.c and unix/gtkdlg.c in the sources, then recompiled. I also had to add '#include "../proxy.h"' to unix/uxproxy.c to get it to recompile, but that's maybe because I'm on FreeBSD.

Anyway, the end result is that it recompiled, and works with the more-or-less expected behaviour.

Louis

Posted 2009-09-22T19:19:27.177

Reputation: 11

1

In Ubuntu 12.04, I was able to paste using Ctrl + Shift + Insert after copying text from a Firefox window or text editor.

Chef Pharaoh

Posted 2009-09-22T19:19:27.177

Reputation: 161

1

One other thing to watch out for (which I just learned about) is that on desktop Linux there are often two different "clipboards" that text can be copied to: X/X11 clipboard and the Gnome/GTK clipboard. This threw me for a bit. I could paste text into some windows, but depending on where I copied it from I couldn't paste in to Putty.

Basically, some applications handle the multiple clipboards and some do not. A few solutions can be found here:
How can I merge the gnome clipboard and the X selection?

One of the most popular programs for syncing both clipboards is autocutsel.

thaddeusmt

Posted 2009-09-22T19:19:27.177

Reputation: 131

0

Just highlight the text for copy and right click for paste.

user10547

Posted 2009-09-22T19:19:27.177

Reputation: 1 089

If only it was that easy... this works under the Windows version but not the Linux version AFAIK – jldupont – 2009-09-22T19:22:09.930

I just tried this running Chrome in Ubuntu inside VirtualBox, and it worked perfectly fine for me. – Travis Northcutt – 2009-09-22T20:12:34.587

@tnorthcutt: maybe some key event handlers are blocking the "cut" functionality on the web page in question. – jldupont – 2009-09-22T20:37:38.283