Pipe putty context to client clipboard?

Is there a command I can execute like

cat <long file> | clipboard

From within a putty session (connected to linux server) to my windows client?

I know I can select an area in the putty client which is instantly in the windows clipboard, but this is done by much scrolling with on a larger text.

I am totally aware that a command executed within the putty session is getting executed in the servers context and is not connected with the windows client, but maybe there is a command which putty recognizes to copy the buffer?

Alternatively, what's the best / easiest / fastest way to copy large texts from a session into the client's clipboard?


If you want to copy all the putty output to clipboard, there is a "Copy All To Clipboard" option available in context menu (right-click) from title bar of the putty window.


There is a putty patch doing exactly what you want.

http://ericmason.net/2010/04/putty-ssh-windows-clipboard-integration/

And this patch has been integrated into kitty.


2020 Answer. As mentioned in previous answers it is possible. Idk how about official Putty because i use KiTTY (enhanced version of Putty) instead.

But all you need is to set Windows clipboard in Terminal > Remote-controlled printing and then use following code as a bash script or a function or whatever you like and then pipe into it.

echo -ne '\e''[5i'
cat  -
echo -ne '\e''[4i'

Usage example: cat <whatever> | puttyclipboard.sh

PS: The content (and the original idea) of the dead website ericmason.net mentioned in previous answer can be found at web.archive.org