162

I would like to paste text the Windows clipboard into my PuTTY session using only the keyboard. I am running PuTTY 0.60 on Windows XP.

Usage example: I just selected a bunch of nice text inside of my Emacs on Windows. I then shift my focus to a Putty window. Then I press the magic keyboard shortcut, and the application waiting for input on the other side gets some.

I have tried the keyboard shortcut to paste into cmd, Alt+Space+E+P, but it doesn't paste the clipboard into my PuTTY window.

This question and answer about opening the system menu using Alt+Space looks interesting, but it doesn't bring me closer to an answer.

So, does anyone know how can I paste the Windows clipboard into my PuTTY session using only the keyboard?

1
  • This is also useful with terminal programs which use mouse events for themselves, such as mcedit. It's impossible to paste into these with a right mouse click. Nov 5, 2021 at 9:42

3 Answers 3

223

You can use Shift+Ins to paste text.

From PuTTY documentation:

Pasting is done using the right button (or the middle mouse button, if you have a three-button mouse and have set it up; see section 4.11.2). (Pressing Shift-Ins, or selecting ‘Paste’ from the Ctrl+right-click context menu, have the same effect.) When you click the right mouse button, PuTTY will read whatever is in the Windows clipboard and paste it into your session, exactly as if it had been typed at the keyboard.
6
  • 7
    Looking at my Macbook air keyboard and windows installed, I wish I had an INS key.
    – adrianTNT
    May 10, 2016 at 14:54
  • Hey, @adrianTNT , on your Macbook, you can simulate Ins with fn+return. So to paste into putty, you can use shift+fn+return
    – Jamey
    Nov 2, 2016 at 17:38
  • 3
    BE CAREFUL DOING THIS. Some characters like " may look the same but be interpreted differently once you paste it into PuTTY - and this was copy pasting from notepad++ so it was plain text Nov 10, 2016 at 19:12
  • @KolobCanyon yeah I noticed! copying from my editor directly to PuTTY always transformed the text, need to always "transform" to plain text by pasting to notepad before
    – pocesar
    Sep 18, 2017 at 8:30
  • 5
    In Windows, just right-clicking the PuTTY console window with the mouse and then hitting enter on the keyboard worked for me. (Note that you obviously need to Copy the password to the clipboard first.)
    – c00000fd
    Sep 25, 2017 at 4:31
3

From the Putty Documentation

4.10.3 Changing the actions of the mouse buttons PuTTY's copy and paste mechanism is modelled on the Unix xterm application. The X Window System uses a three-button mouse, and the convention is that the left button selects, the right button extends an existing selection, and the middle button pastes.

Windows typically only has two mouse buttons, so in PuTTY's default configuration, 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.

You have to change the default behavior by opening Putty > Windows > Selection > Select "xterm (Right extends, middle pastes)"

3

In my case I want Ctrl-Ins / Shift-Ins only, thus, my config was:

  • Window > Selection
    • Auto-copy selected text to system clipboard > (unchecked)
    • Mouse Paste > (No action)
    • {Ctrl,Shift}+Ins > (System clipboard)

You need this to VIM works:

  • Terminal > Features
    • Disable application keypad mode (checked)

Extra:

PuTTY operates just like a normal X terminal... Some commands will output to an "alternate" screen when the xterm terminal type is selected, such as "less" (or "vi"), which dissapears when the program exits.

However, you can disable the alternate screen with:

  • Terminal > Features
    • Disable switching to alternate terminal screen (checked)

You must log in to answer this question.

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