36

I'm using PuTTY on Ubuntu 14.04 (Trusty Tahr) to connect to a serial port. I need to copy text from a PuTTY window to another window (for example, gedit).

UPDATE

I can copy by selecting text with the mouse and paste it by mouse middle click. But it does not work when I paste from another window.

UPDATE1

I haven't succeeded to fix this issue, but I've switched to the Ubuntu-native application GtkTerm which can copy-paste as usual from the Ubuntu terminal.

muru
  • 197,895
  • 55
  • 485
  • 740
fsquirrel
  • 491

9 Answers9

26

I've copied from the PuTTY manual:

PuTTY's copy and paste works entirely with the mouse. In order to copy text to the clipboard, you just click the left mouse button in the terminal window, and drag to select text. When you let go of the button, the text is automatically copied to the clipboard. You do not need to press Ctrl-C or Ctrl-Ins; in fact, if you do press Ctrl-C, PuTTY will send a Ctrl-C character down your session to the server where it will probably cause a process to be interrupted.

Frantique
  • 8,493
  • 7
    Thank you for quick reply but for me it does not work... I can copy by selecting(drag and drop) and paste by middle mouse click. But I cannot paste selected to another window. – fsquirrel Jul 30 '15 at 12:51
  • This is weird. The copied content goes to Windows's clipboard, so it should be accessible to others as well. – Frantique Jul 30 '15 at 12:56
  • I'm not sure that I understand what Windows you mean. – fsquirrel Jul 30 '15 at 12:57
  • 1
    Ohh, sorry, I missed the Ubuntu host part. :) Why do you use Putty and not a normal Terminal with SSH session? – Frantique Jul 30 '15 at 13:01
  • 1
    As I'm connecting to device via UART. It is serial port connection not ssh. – fsquirrel Jul 30 '15 at 13:12
  • thanks for this comment.. it seems there are quite a few conflicting information and posts with little clarification about what system they are using. I guess I can stop looking for a keyboard shortcut after spending numerous hours. i can copy and paste into VIM but for copying from vim into windows applications, I will have to use mouse.. – alpha_989 Jul 24 '17 at 13:35
  • 3
    @fsquirrel the solution is very simple, it's funny. Just don't CTRL + V to paste in the other application, use MIDDLE mouse button. – Accountant م Apr 18 '19 at 23:44
  • @Accountantم this worked for me, use MIDDLE mouse button can copy from outside to Putty, also copy from Putty to outside. – fudu Oct 04 '21 at 06:41
12

COPY: Simply highlight text in PuTTY. Press and keep pressed left mouse button + move mouse to highlight the text you want + release left mouse button and text will be copied to the clipboard.

PASTE: Just click the middle mouse button to paste clipboard text in PuTTY itself or every other application that has a text prompt. Please note that modern mice don't have the middle 'button' but usually a wheel, so you have to click on the wheel. If you are using a laptop, tapping on the upper right corner of the touchpad (or on some models, pressing both buttons simultaneously) should reproduce a mouse middle click.

Zanna
  • 70,465
bytepan
  • 501
  • 1
    This work, but not for all applications, for example it is not possible to copy text directly in Firefox, in a text area of a web page. I need to copy to an opened text editor first. – Fabiano Tarlao Apr 21 '17 at 08:48
  • 1
    This answer almost resolved my confusion. Important detail: PuTTY's 'copy' is not to the clipboard. The normal clipboard will still be unmodified. This makes it seem like left button select did nothing. Left button select in PuTTY, then scroll button press in gedit to paste worked. – jws Jul 26 '18 at 20:35
11

I found the solution here

Problem

Copy Paste text from PuTTY to Another Application on Ubuntu not working

solution

Select the text you want to copy on the screen and leave as it is. This will copy the text to PuTTY clipboard.

pasting to other application:

Go to the other application and press the middle button of the mouse. If your mouse only has two buttons, then press both left and right buttons simultaneously, it will paste the text on the other application. However, if you try to use CTRL + V , it will paste the content which is present in the default clipboard.

This worked for me on Fedora

5

I had same problem.
Despite suggestion from manual, left mouse button selection for copying text does not work for me.
I had found that middle mouse button does the trick.

fat
  • 199
2

Simple; just highlight the text in putty and right click. Note, though, that this will also paste the text into whatever you are working on in Putty.

For example, if you are copying text from Vim or Nano, highlight the text you want to copy, right click it, and then quit without saving.

1

just highlight the text on the terminal and click both right and left buttons on your touch pad simultaneously.

go to the text document and click the both buttons simultaneously for copying the details from terminal to text document.

this is what worked for me ..im on ubuntu 16.04 LTS

MANOJ
  • 11
1

You can use cat Abc.java to show the content of file. Then highlight the text and CTRL + C to copy the text.

After that, you can paste any where you want.

vtc94
  • 11
1

There is an ugly way that I use to copy from Putty console. In Putty configuration window, I have enabled Session Logging to get the console output dumped to a file on my system.

My Putty Session Logging Configuration

Then I tail the log file in a local terminal with command:

tail -f <logFileName>

When I have to copy something, I go to the local terminal where the log is being tailed and copy what I need with CtrlShiftC.

muru
  • 197,895
  • 55
  • 485
  • 740
0

I have this same issue when working remotely using X, where I can't copy/paste from the remote putty window, which is displaying on my workstation, to local applications, e.g. copying a cisco configuration to a local text editor. My inelegant solution: remotely run gedit, paste into that, and then copy from gedit to the local host, which works.