polacode
polacode copied to clipboard
allow copying to clipboard instead of saving as a file
Just tried out Polacode and while it is cool, this was my immediate thought as well.
Absolutely, a must have functionality!
Yep, had it in mind but didn't make it for MVP.
This seems impossible with the current API. The Electron webview can't do it per this Chromium Bug. On macOS, pbcopy does not take image input. Electron does have an API but VS Code does not expose it.
I'm asking for it: https://github.com/Microsoft/vscode/issues/217#issuecomment-366495874
@octref I tried to implement it this with the electron nativeImage + clipboard modules but can't get it running. I think we have to wait for Microsoft to expose the clipboard API via vscode.
I don't think this solves this issue but can we have like a toggle to preview the image and right-click that and have Chrome's copy image functionality? Is that possible in VS Code right now? I checked the image previewer in Code but that doesn't allow me to copy the image being previewed.
Random thought: has anyone tried using Canvas?
From image, use drawImage.
In Chrome, right-clicking canvas allows you to copy image.
@kamranayub On the same lines as I was wondering which I posted above but right-clicking doesn't seem to popup any context menus inside VS Code.
I implemented it by spawn another electron process in vscode... At least it can work. 😅 https://github.com/maple3142/polacode
+1, I want to use this extension to copy paste code into emails. I'm not going to go through saving a file and importing for that.
Someone made a fork that fixes a bunch of things, so I'd use that for the time being.
duplicate of #70? I'd really like this feature too!
I created an npm library for copying images to clipboard that you're free to use:
https://www.npmjs.com/package/img-clipboard
This is definitely cool feature, will raise an PR for it when I'm not so busy.
Awesome feature, very useful
Hi, any updates on this?
I found an extension that already implements this very useful feature. https://marketplace.visualstudio.com/items?itemName=adpyke.codesnap