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

Fetch clipboard from other side (files) fails #21

Closed
RetGal opened this issue Dec 27, 2020 · 9 comments · Fixed by #23
Closed

Fetch clipboard from other side (files) fails #21

RetGal opened this issue Dec 27, 2020 · 9 comments · Fixed by #23

Comments

@RetGal
Copy link

RetGal commented Dec 27, 2020

When I try to fetch clipboard from other side (which is actually on the same host running Debian 10)
I get an copy clipboard failed error.

The content of the client-clipboard-1609069044630.txt:

x-special/nautilus-clipboard
copy
file:///home/foo/bar/test/dvi%20(Kopie).jpg
file:///home/foo/bar/test/Foo

The error thrown in the terminal:

Error: Couldn't find the 'xsel' binary and fallback didn't work. On Debian/Ubuntu you can install xsel with: sudo apt install xsel
    at makeError (/snapshot/ezshare/node_modules/clipboardy/lib/linux.js:14:11)
    at xselWithFallback (/snapshot/ezshare/node_modules/clipboardy/lib/linux.js:31:10)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
@mifi
Copy link
Owner

mifi commented Dec 28, 2020

does it work if you install xsel?

@RetGal
Copy link
Author

RetGal commented Dec 29, 2020

Yes, it does.

@mifi
Copy link
Owner

mifi commented Dec 29, 2020

I think clipboardy which ezshare uses needs some way to copy the clipboard. Without xsel it seems to not be able to do that

@RetGal
Copy link
Author

RetGal commented Dec 29, 2020

In fact, they already have an open issue regarding this problem.

@Maxime-J
Copy link
Contributor

Maxime-J commented Jan 26, 2021

does it work if you install xsel?

@mifi Actually, clipboardy has fallback binaries included, so it should work even without xsel installed.
That leads me to the same issue on Windows with the standalone:

It tries to spawn C:\snapshot\ezshare\node_modules\clipboardy\fallbacks\windows\clipboard_x86_64.exe which of course doesn't exist here.

Error: spawn C:\snapshot\ezshare\node_modules\clipboardy\fallbacks\windows\clipboard_x86_64.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

As RetGal is also using the standalone version, it's surely linked.

@mifi
Copy link
Owner

mifi commented Jan 26, 2021

Ahh. So in such case maybe during build we need to extract the fallback binaries and place them along with the ezshare exe (so it cannot be only a single EXE anymore if we want to support fallback)

@Maxime-J
Copy link
Contributor

Yes, or they could be extracted from the snapshot at run time, like suggested here (vercel/pkg#342).
But anyways, clipboardy has to be patched during build (before pkg) to make it work.
I could spend some time on it if needed.

@mifi
Copy link
Owner

mifi commented Jan 26, 2021

I guess the best solution would be to use native code directly from node as the fallback, however it seems like pkg does not yet support native.

If you want you could have alook at this. A problem could be that when there is an additional exe bundled along with ezshare, maybe Windows/MacOS will refuse to let ezshare execute the unsigned binary.

@Maxime-J
Copy link
Contributor

Will make a pull request very soon with bundled binaries for Windows and Linux (macOS relies on included system commands)
Tested it and no problem :)

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

Successfully merging a pull request may close this issue.

3 participants