←back to thread

2039 points Gadiguibou | 9 comments | | HN request time: 1.476s | source | bottom
1. n8henrie ◴[] No.36497293[source]
So much of my Linux use is over ssh from a MacOS client that I've made a `pbcopy` executable that just pipes stdin over ssh to my MacBook to its pbcopy (with a dedicated ssh key that runs this as a forced command). Makes it super nice to be on an SSH session and `pbcopy` some content to my MacOS clipboard!
replies(2): >>36498271 #>>36501708 #
2. danielagos ◴[] No.36498271[source]
That sounds amazing, I always wanted to do that! Do you have a guide or some script to help with it? Otherwise, I will try to do it on my own.
replies(1): >>36502413 #
3. SushiHippie ◴[] No.36501708[source]
You might want to have a look at osc52
replies(1): >>36502405 #
4. n8henrie ◴[] No.36502405[source]
I have! Unfortunately not supported in MacOS Terminal.app, which I'm otherwise very satisfied with (have tried iTerm2, use Alacritty on Linux, just like Terminal.app).
replies(1): >>36507571 #
5. n8henrie ◴[] No.36502413[source]
Happy to share, but I'm away from my MacBook for the next 2-3 weeks. I'll ping you when I have access to the code again.
replies(1): >>36512036 #
6. athrun ◴[] No.36507571{3}[source]
Simply wrap your shell with osc52pty to get OSC52 support in Terminal.app

https://github.com/roy2220/osc52pty

replies(1): >>36516847 #
7. desro ◴[] No.36512036{3}[source]
I'm also super interested in this! I've had many amusing moments of instinctively typing either `pbcopy` or `pbpaste` on remote boxes followed by a brief moment of confusion when my local clipboard isn't updated :)
8. n8henrie ◴[] No.36516847{4}[source]
I don't think wrapping my entire shell session in a moderately complex third party tool (that maybe just uses pbcopy under the hood[1]) counts as "simply" when compared to my existing solution which just pipes over ssh and a couple bash scripts.

But thank you for the share, it is interesting!

[1]: https://github.com/roy2220/osc52pty/blob/master/oscexecutor....

replies(1): >>36521545 #
9. athrun ◴[] No.36521545{5}[source]
This tool isn’t doing anything particularly complex. It sets up a new pty, attaches the child process to it, listens for OSC52 control codes, and calls pbcopy when appropriate.

You can wrap your ssh session with it and you’re done.

It’s very elegant and multiple orders of magnitude less complex than something like tmux.