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.

Copy to clipboard

See original GitHub issue

I use most of my Carbon images on Twitter to illustrate some code snippet. Would be useful if this tool could just put the image in the clipboard instead of writing to disk. For example, if I use the a --copy flag.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
mixncommented, Oct 19, 2018

I just published v1.3.0 where this is available. 🙂🎉 npm i -g carbon-now-cli to update to that version.

✅ Cross-OS 😱 ✅ Docs are here

Example of using it with a preset + pasting to Twitter:

copy-demo

Thank you all for chiming in! ❤️

0reactions
mixncommented, Oct 16, 2018

@sindresorhus Maybe you could chime in on this since I am using your lovely execa to run the OS-specific scripts. 🙂 As mentioned in my comment above, it works flawlessly on macOS — it copies to clipboard and exits properly.

macos

On Linux, it copies properly, but doesn’t exit — it’s like the Promise is pending forever. You can see it doesn’t exit the Copying image to clipboard stage inside the Listr task.

linux

The relevant code for this can be found in this section of cli.js. Am I missing something here?

I’ve also noticed that it exits and copies properly on Linux when I use execa without await. It doesn’t copy to clipboard on macOS then though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

copy-to-clipboard - npm
Simple module exposing copy function that will try to use execCommand with fallback to IE-specific clipboardData interface and finally, resort ...
Read more >
How To Copy to Clipboard - W3Schools
Learn how to copy text to the clipboard with JavaScript. Click on the button to copy the text from the text field. Copy...
Read more >
Copy and paste using the Office Clipboard - Microsoft Support
Open the file that you want to copy items from. · Select the first item that you want to copy, and press CTRL+C....
Read more >
Copy to Clipboard - Apps on Google Play
Simple function, help copy photo from your gallery to clipboard. you can utilize Google Keyboard to paste to other apps that support pasting...
Read more >
clipboard.js — Copy to clipboard without Flash
Copy text to the clipboard shouldn't be hard. It shouldn't require dozens of steps to configure or hundreds of KBs to load. But...
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