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

Can't Write to Clipboard (Possibly Linux-related) #48

Closed
gazugafan opened this issue Mar 22, 2019 · 13 comments · Fixed by #50
Closed

Can't Write to Clipboard (Possibly Linux-related) #48

gazugafan opened this issue Mar 22, 2019 · 13 comments · Fixed by #50
Labels
bug 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted

Comments

@gazugafan
Copy link

gazugafan commented Mar 22, 2019

Issuehunt badges

I've gotten a couple bug reports on my VS Code extension that uses Clipboardy. It seems that there's sometimes a problem calling clipboardy.write(). I haven't been able to reproduce it myself, but both users are running Linux. One in particular is running: Linux x64 4.9.0-8-amd64 (SolydX 9 / Debian Stretch)

One of them gave the following error log...

[Extension Host] Error pasting... TypeError: Cannot read property 'end' of undefined
	at handleInput (/home/sembiance/.vscode/extensions/gazugafan.vscode-indent-on-paste-2.3.2/node_modules/execa/index.js:75:17)
	at module.exports (/home/sembiance/.vscode/extensions/gazugafan.vscode-indent-on-paste-2.3.2/node_modules/execa/index.js:273:2)
	at Object.copy (/home/sembiance/.vscode/extensions/gazugafan.vscode-indent-on-paste-2.3.2/node_modules/clipboardy/lib/linux.js:17:10)
	at Object.exports.write.input [as write] (/home/sembiance/.vscode/extensions/gazugafan.vscode-indent-on-paste-2.3.2/node_modules/clipboardy/index.js:28:20)
	at indentOnPaste (/home/sembiance/.vscode/extensions/gazugafan.vscode-indent-on-paste-2.3.2/out/src/extension.js:96:24)

... the line in my extension triggering this error (out/src/extension.js:96:24) is calling clipboardy.write(). It looks like this...

clipboardy.write(clipboard_1).then(function () {
    ...
}, function () { pasting = false; });

... which seems to be really straightforward to me. Not sure what's going wrong, but according to the error log it could be up in clipboardy or execa. Any ideas? Are there any known issues with clipboardy on certain flavors of Linux?


IssueHunt Summary

stroncium stroncium has been rewarded.

Sponsors (Total: $40.00)

Tips

@gazugafan
Copy link
Author

Original bug report in my extension, just for context...
gazugafan/vscode-indent-on-paste#3

@gazugafan
Copy link
Author

The other bug reporter mentioned that his OS is Linux x64 4.20.6 (Gentoo).

@sindresorhus
Copy link
Owner

Seems to be some problem with reading the stdout stream. Possibly an Electron issue or difference with Node.js. Hard to say for sure without the ability to reproduce it.

@gazugafan
Copy link
Author

@jdall @Sembiance can you offer any more info to help reproduce the issue?

@jdall
Copy link

jdall commented Apr 10, 2019

Sure, @gazugafan - if you can tell me what you need, and how to produce it. You know your plugin, and the ecosystem it is installed in. I'm a mere user, knowing nothing about either.
These days, it's so easy to run OS's virtualised. May I suggest that you install VirtualBox and deploy Gentoo or SolydX 9 (the latter is probably the easiest to get started with for a Windows user).
I would be glad to help, but some guidance is needed.

@gazugafan
Copy link
Author

@sindresorhus any chance you can try (or already did try) reproducing this on Gentoo or SolydX? I can certainly try myself, but even if I'm successful I'm not sure what else I could do besides give you the same error log. Do you think we should report this issue somewhere else?

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 2, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $40.00 to this issue.


@stroncium
Copy link
Contributor

stroncium commented May 6, 2019

@gazugafan When #50 and sindresorhus/execa#212 get released, it will allow you to see the root error.
Until it didn't happen: either you changed permissions on fallback binary fallbacks/linux/xsel or vscode did it for you. If it is the former, fix your distribution to have execution permission on this binary. If it is the latter, it would probably be a good idea to file a bug report against vscode, but in the meantime, you can check execution permission on extension start and change it if needed.

@stroncium
Copy link
Contributor

@gazugafan BTW, if it is a problem vscode introduces, not your packaging, please tell us, it might make sense to introduce handling of such condition right in library, as it should only require a couple of code lines.

@gazugafan
Copy link
Author

Thanks @stroncium !! Yeah you were definitely on the right track. I was packaging the extension on Windows, so your question about executable permissions on the xsel binary made me raise an eyebrow. Turns out, packaging under Windows would remove any executable permissions. I just had to package the extension under Linux to make sure the execute permission sticks. I think that's going to solve it :D

@gazugafan
Copy link
Author

I've just released a new version which I think is going to solve this for the users that originally reported the problem. As soon as I hear back from them, I'm pretty sure I'll be closing this.

@gazugafan
Copy link
Author

We're good. Thanks again!

@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Jun 14, 2019
@issuehunt-oss
Copy link

issuehunt-oss bot commented Jun 14, 2019

@sindresorhus has rewarded $36.00 to @stroncium. See it on IssueHunt

  • 💰 Total deposit: $40.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $4.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants