Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Clipboard for Linux, Windows, macOS, and *BSD #92

Open
Slackadays opened this issue Feb 4, 2023 · 2 comments
Open

Use Clipboard for Linux, Windows, macOS, and *BSD #92

Slackadays opened this issue Feb 4, 2023 · 2 comments

Comments

@Slackadays
Copy link

Slackadays commented Feb 4, 2023

The project Clipboard now supports X11, Wayland, Windows, and macOS. I realized that you could now switch from using xsel and clipboard.exe and pbcopy to just clipboard for all those platforms at the same time. In addition, this change would also fix #38 due to the new Wayland support too. This also means you can support the BSDs as well!

In the code, you would condense all the different cases except Android into one that just calls clipboard. For the fallbacks, you would just bundle Clipboard for the various platforms you support.

Edit: This would also enable support for Linux/BSD where there isn't X11/Wayland because CB doesn't depend on them to exist.

@sindresorhus
Copy link
Owner

Thanks for the suggestion. The Windows and macOS variants are working fine, so I wouldn't touch those. Fixing Linux sounds nice though. However, I have some concerns:

  1. It's notoriously hard to ship Linux binaries (ABI incompatibilities, system dependencies, etc). I have a feeling this will cause a lot of support headache.
  2. The code is GPL. Even though that should not apply to the binaries, I could cause licensing issues.
  3. I don't trust anything written in C++. I would have preferred to adopt a binary written in a memory-safe language like Rust.

@Slackadays
Copy link
Author

  1. Although this is true, it looks like xsel is already getting shipped which would put CB at no worse a position than before if it was just swapped out.
  2. It looks like xsel has some bespoke license that almost looks like MIT but not quite. xclip and wl-clipboard use GPL, though, so there's that.
  3. I can see where you're coming from. However, consider that all these other utilities are written in C which has zero memory-safe features at all, and CB uses C++20 with enough pointers to count on one hand, so we're in a better position than either C or the "bad old days" of C++98 where it was C but worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants