Can't Write to Clipboard (Possibly Linux-related)
See original GitHub issueI’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 has been rewarded.
Sponsors (Total: $40.00)
issuehunt ($40.00)
Tips
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on IssueHunt to raise funds.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@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.
@sindresorhus has rewarded $36.00 to @stroncium. See it on IssueHunt