▲ 51 points
back
8 comments
`xsel --clipboard` has identical behaviour if you are on Linux. But I guess the wrapper is still nice to abstract across OSes.
Cheers mate! Never knew of that cmd.
Just added this to my shell alias config on Nix and it works nicely, even with pipes
`cp = "${pkgs.xsel}/bin/xsel --clipboard";`
cp?!
The code is basically a no-op but it is quite clever. devilishly intuitive.
The example section at the bottom of the page makes it clear that this solves a problem that I did not know I had. I quite dislike copy and paste into the terminal, but the ergonomics of pbcopy and pbpaste of never really worked for me so I muddled through. I thought this was no great loss, but after looking at the examples clearly either need to try them again or just use cb.
pbcopy and pbpaste are what turned me on to this use case. pbcopy ~/.ssh/id_rsa.pub is so handy.
I already have reasonable aliases in my shell (for Linux shells, because pbcopy and pbpaste are intuitive enough that I use those as the alias names), but there's just enough clever here that I'll probably replace it with this.
You may also like: https://github.com/jwilk/viclip