News for hackers. Stuff that matters.
Re:Yank: Yank Terminal Output to Clipboard by knazarov on Sunday March 28, 2021 @06:53AM (#26609309)
There's a better way to do it. Terminals have a special escape sequence called OSC 52, which allows you to insert into the clipboard from even remote SSH sessions. Try this:

printf "\033]52;c;$(printf "%s" "blabla" | base64)\a"

Re:Yank: Yank Terminal Output to Clipboard by jeduardo on Sunday March 28, 2021 @10:23AM (#26610628)
Hey, that's quite interesting. Just tested it here with alacritty and was able to get data from a remote server into the clipboard. The downside here is that it did not seem to work immediately from inside tmux, but a quick search shows that there are ways to make it work. Also found a vim-plugin[1] that would allow it to work from inside vim as well. If I can also find a way to pipe random commands to it, it might indeed work better than clipper for my use cases. Finally, there is the added benefit of removing the need to forward the local UNIX socket over SSH, which I find to be a bit flaky. Thanks for sharing it!

[1] https://github.com/ojroques/vim-oscyank

Re:Yank: Yank Terminal Output to Clipboard by mdaniel on Sunday March 28, 2021 @02:45PM (#26612986)
I've found a couple of random blog posts and some user's pages laying out the OSC codes, but is there an open reference of them?

I have also considered trawling through the various terminal emulator source repos in order to know which are actually implemented (since that can for sure be a different set from those which are specified)