question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stronciumcommented, May 10, 2019

@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.

0reactions
issuehunt-app[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
Read more comments on GitHub >

github_iconTop Results From Across the Web

'Copy to clipboard on selection' doesn't work on Linux
1. Go to Settings/Tools/Terminal · 2. Check 'Copy to clipboard on selection' option. · 3. Go to terminal and select any text
Read more >
How to write to clipboard on Ubuntu/Linux in R? - Stack Overflow
This approach works for me (based on others' solutions). write_clipboard = function(x, .rownames = F) { ...
Read more >
Copy and paste doesn't work in the terminal - Ask Ubuntu
Mark the text, that you want to paste by pressing the left mouse button and move the mouse. Press shift + ctrl +...
Read more >
Unblocking clipboard access - web.dev
The traditional way of getting access to the system clipboard was via document.execCommand() for clipboard interactions.
Read more >
Bug #11334 “MASTER Copy-Paste doesn't work if the source ...
When I copy (Ctrl + C, or right click and "Copy") text from somewhere and after that close the program where it is,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found