←back to thread

2039 points Gadiguibou | 1 comments | | HN request time: 0.444s | source
Show context
klausa ◴[] No.36491947[source]
`pbcopy` and `pbpaste` are one of my most-loved in the list.

Dealing with some minified json, switching to iTerm, doing `pbpaste | json_pp | pbcopy` and having a clean output is _so_ nice.

replies(28): >>36492008 #>>36492015 #>>36492028 #>>36492101 #>>36492108 #>>36492229 #>>36492265 #>>36492890 #>>36492953 #>>36493037 #>>36493127 #>>36493336 #>>36493457 #>>36493802 #>>36494023 #>>36494242 #>>36494325 #>>36495379 #>>36495894 #>>36496866 #>>36497033 #>>36497293 #>>36497589 #>>36497973 #>>36498181 #>>36498558 #>>36498586 #>>36535798 #
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 #
SushiHippie ◴[] No.36501708[source]
You might want to have a look at osc52
replies(1): >>36502405 #
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 #
athrun ◴[] No.36507571[source]
Simply wrap your shell with osc52pty to get OSC52 support in Terminal.app

https://github.com/roy2220/osc52pty

replies(1): >>36516847 #
n8henrie ◴[] No.36516847[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 #
1. athrun ◴[] No.36521545[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.