Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way of selecting a text with keyboard the way I do it normally using Shift+arrows.

share|improve this question

migrated from Dec 20 '09 at 18:30

This question came from our site for professional and enthusiast programmers.

I think it is impossible. :( – Lucas Jones Dec 20 '09 at 18:28

12 Answers 12

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.

share|improve this answer
My line is 24k characters long. How can I copy it over? I can only see the last part of the line or the first part on the screen buffer. – Gaʀʀʏ Sep 8 '14 at 19:30
@Gaʀʀʏ I know you've long moved on from this comment, but I'd just like to note that if I have a 24k line to copy, I think the 'Copy All to Clipboard' option is justified. It's certainly what I'd call an edge case. – Sean Allred May 3 at 14:07

so far as I know, there is no means of copying a selected area from the putty window to the Windows clipboard without using the mouse. there is a feature request on the putty site specifically for this functionality.

the only way to copy information from the putty window to the Windows clipboard with a keyboard shortcut is to use the app system menu "copy all to clipboard" (which you can invoke from alt-space, provided you set the "Window > Behavior > System menu appears on ALT-Space" option configured in putty.

Pasting from the Windows clipboard into putty can be done with Shift-Insert.

If you need to copy and paste only within the terminal window itself, refer to either the man page for the shell you're using or consider using the unix "screen" app ('man screen' for more info), which allows text selection for copy / paste within the terminal window (similar to how vi's copy / paste works). an excerpt from the man pages:

   C-a esc     (copy)        Enter copy/scrollback mode.

   C-a ]       (paste .)     Write the contents of the paste buffer to the
                             stdin queue of the current window.

   C-a {
   C-a }       (history)     Copy and paste a previous (command) line.

   C-a >       (writebuf)    Write paste buffer to a file.

   C-a <       (readbuf)     Reads the screen-exchange file into the paste

   C-a =       (removebuf)   Removes the file used by C-a < and C-a >.
share|improve this answer
@xgMz - Works fine for me. Surprising that that ticket was filed over 13 years ago and nobody has bothered doing it yet. – ArtOfWarfare Jul 4 at 2:12
Link works now. – xgMz 10 hours ago

control+insert = copy

shift+insert = paste

share|improve this answer
I don't know why this was downvoted. It's the only answer that worked for me. I was able to make an AutoHotkey script that copies text from GVim in Windows, pastes it to Putty, and runs it in an interactive IPython session – rsoren Dec 18 '14 at 18:18
control+insert seems to do absolutely nothing. shift+insert does paste, though. – ArtOfWarfare Jul 4 at 2:09

This may be more of a workaround than a solution.

Within vim, if you want to copy a block that you selected in visual mode (usually a block that spans many pages), you can write it to a file (by typing :w filename.txt while the text is selected and while you're still in visual mode). Once you've done that, you can:

  1. Open the file in a Windows editor if it's mounted over Samba
  2. Read the file contents via Apache or an FTP server
  3. Email the file as an attachment (see command below -- requires Mutt):

    echo "My Message Body" | mutt -s "my subject line" -a filename.txt --

Personally I prefer option 1.

share|improve this answer

To work around this problem, run PuTTY in a Windows console replacement such as ConEmu or SuperPutty.

share|improve this answer
How do you do this in SuperPutty? – grokster Jan 15 '14 at 1:35

Another somewhat makeshift suggestion is to activate Mouse Keys within Windows. In Windows 7 it's under the Ease of Access Center.

  1. Click "Make the mouse easier to use".
  2. Check on the checkbox that says "Turn on Mouse Keys".
  3. Click on "Set up Mouse Keys" for additional settings.

The default Mouse Keys hotkey is Alt + Shift + NumLock.

Hopefully hitting this key combination won't interfere with your session (or just Alt + Tab out and activate it from outside putty). I believe hitting 0 on the numpad starts a click lock, allowing you to drag over the portion of text you want to highlight/copy.

share|improve this answer

I use GNU screen,

I also have this in my screenrc to play nicely with vim:

register [ "\033:se paste\015a"
register ] "\033:se nopaste\015a\033"
bind ^] paste [.]

A friend of mine has a hook in screen to copy the "screen clipboard" to one or both of the x clipboards (selection or clipboard) and I believe putty does the needed translations. I'll try to dig it up.

You can probably arrange the same thing with xclip, the incantation you're looking for should be using xclip -selection clipboard

I'd test quickly to see if xclip -selection clipboard -o spits out the contents of your clipboard.

share|improve this answer

I was tired of scrolling down line by line via mouse left button to copy session output. But now, i need to click on middle button twice; first at the beginning and second at the end. How I did :

  1. Go to Putty Configuration window
  2. Choose "Selection" from category on the left of the window.
  3. Under 'Control use of mouse', choose 'Compromise (Middle extends, Right pastes)' if not already chosen.
share|improve this answer
Please read and make yourself understand the question and then try to answer it. – Renju Chandran chingath Oct 30 '14 at 11:34

Yes Copy and Paste works in Putty on Linux as well. Steps are as follows :

  1. Select the text from putty window.
  2. Use Mouse wheel click same thing will be copied on Putty window as well,which can be ignored.
  3. Open any editor and Paste it.
share|improve this answer

If you want to search whole data present in putty then perform the task(command) on putty as you do and then right Click on the Head of Putty (Somewhere near to Minimize/Close button) and select Copy all to CLipboard and paste it wherever you want.

share|improve this answer
But how to click that using keyboard only, like the question asked for? – Arjan Nov 23 '14 at 13:02
Please read the question again carefully. Your answer does not answer the original question. – DavidPostill Nov 23 '14 at 14:14

If you are on windows machine it will work fine but if in case linux based machine it sometime won't work. To make it work just copy the content on any text editor and just use Shift + Insert key at line where you want to paste that.

Hope this would help!

share|improve this answer

A tip is to use Mouse Keys in Windows (or in X-Windows) as described here: or here Thank God, now I can finally completely use the keyboard for PuTTY and so on. A tip when using Mouse Keys is to set both the "Pointer speed->Top speed" and "Pointer speed->Acceleration" to the maximum.

share|improve this answer

You must log in to answer this question.