Pipe putty context to client clipboard?

8

1

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?

Daniel W.

Posted 2014-09-26T09:35:01.123

Reputation: 1 462

I don't know if there's a command that can transfer to the clipboard, but I would just output to the screen, and use putty's log function to catch the output. See also: http://my.kualo.com/uk/knowledgebasekualo.php?kbcat=0&article=888

– LPChip – 2014-09-26T10:02:27.597

Answers

2

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.

tonioc

Posted 2014-09-26T09:35:01.123

Reputation: 787

This is by far the fastest way to copy a large buffer. – Daniel W. – 2014-09-26T10:40:33.540

1this doesn't play nicely with tmux when set -g mouse on – AK_ – 2018-02-09T19:03:20.503

3

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.

Sulisu

Posted 2014-09-26T09:35:01.123

Reputation: 51

kitty is a good point, it's open source. but this eric mason page i could not find the source of his "modified putty". Very dangerous. – Daniel W. – 2016-03-23T14:44:47.590

1

@DanFromGermany The source code is provided as a small patch to original putty 0.60 source, and the patch link is at bottom of the blog, before comment area.This is direct patch link

– Sulisu – 2016-04-24T22:56:44.807

1Using this with KiTTY, but I modified the function slightly to avoid using the $* as I feel weird about using that BASH expansion there. I went with function wcb { cat <(echo -ne '\e''[5i') - <(echo -ne '\e''[4i') } instead. – Alan Hensley – 2017-09-29T01:46:04.987

0

I am using Linux Mint Cinnamon here and my version of PuTTY does't have contextual menu.

I had to copy selecting what I wanted to copy in PuTTY and clicking the middle button (scroll), and then paste it with that same button (instead of right click and paste).

Apparently Mint has two clipboards.

Lucio Mollinedo

Posted 2014-09-26T09:35:01.123

Reputation: 101

Please answers are not set for comment, if you can answer the question answer it properly – yass – 2017-04-04T18:18:15.187

The initial comment wasn't meant to be criticism but to shed some light into why I was posting this answer. Anywho, I changed the answer . – Lucio Mollinedo – 2017-04-04T22:58:34.923

-1

run Apache SSHD

then from your Linux box:

date | ssh -p 8000 myworkstation "cmd /c clip.exe"

weberjn

Posted 2014-09-26T09:35:01.123

Reputation: 325