mushanshitiancai / vscode-paste-image

paste image from clipboard to markdown/asciidoc directly!
MIT License
429 stars 129 forks source link

"There is not an image in the clipboard" for Remote WSL #56

Open mosh-shu opened 4 years ago

mosh-shu commented 4 years ago

Hi, I'm trying to use your amazing plugin under this environment:

When I try to paste any image, the little pop-up window tells me that "there is not a image in your clipboard". Your plugin works beautifully when I run VS Code directly on Windows 10.

image

Do you have any solutions?

heyzling commented 4 years ago

The same for Remote-SSH. It seems remote clipboard is used, not local. I found mention of this problem at https://code.visualstudio.com/docs/remote/troubleshooting#_clipboard-does-not-work . Not sure if fix they offer can work with images. It seems, API methods work only with text content.

spottedmahn commented 4 years ago

It seems, API methods work only with text content.

Hi @heyzling - where did you see that? I didn't see it under Clipboard does not work.

spottedmahn commented 4 years ago

It seems, API methods work only with text content.

Nvm, found it Clipboard API 😀

image

snt commented 4 years ago

It could be workaround.

I am using Ubuntu/WSL2 + X410 in Windows 10. Paste Image fails with same error while I stop X410. WSL2 runs locally but it has different IP address unlike WSL1 that sharing localhost, so WSL2 basically similar to remote WSL.

sakamoto66 commented 4 years ago

This has been resolved.

https://marketplace.visualstudio.com/items?itemName=sakamoto66.vscode-paste-image

use image of clipboard from local pc. So there is no need to use "shared clipboard".

when local pc is windows, xclip is unnecessary.

DigitalMarc commented 4 years ago

Hey, I'm using the latest version (just installed it) and I'm getting "There is not a image in clipboard." I'm copying from a Win 10 (Snipping tool.exe) to a virtualbox VM (Ubuntu 20). Regular copy paste is ok between the two.

sakamoto66 commented 4 years ago

hi, @DigitalMarc .

"There is not a image in clipboard."

This is error message of extension Paste Image(mushan.vscode-paste-image).

You installed extension Paste Image(mushan.vscode-paste-image). It's not supported Remote Development.

Extension Paste Image from local pc(sakamoto66.vscode-paste-image) is supported Remote Development.

Please run step1-2. step1, uninstall extension Paste Image(mushan.vscode-paste-image). step2, install extension Paste Image from local pc(sakamoto66.vscode-paste-image).

DigitalMarc commented 4 years ago

@sakamoto66 thanks for the feedback, This time I'm getting Error: image of clipboard is empty It might be related to this: https://forums.virtualbox.org/viewtopic.php?f=6&t=93937

sakamoto66 commented 4 years ago

hi, @DigitalMarc Please let me check. Is the environment being tested a plan A?

vezaynk commented 2 years ago

This repository has not seen any activity in over 3 years. There is an actively maintained fork here: https://github.com/telesoho/vscode-markdown-paste-image

I added WSL support to it yesterday, do take a look.

dzylikecode commented 2 years ago

Would you like to try my extension, here is the market:https://marketplace.visualstudio.com/items?itemName=dzylikecode.md-paste-enhanced

ZhangSIming-blyq commented 1 year ago

This has been resolved.

https://marketplace.visualstudio.com/items?itemName=sakamoto66.vscode-paste-image

use image of clipboard from local pc. So there is no need to use "shared clipboard".

when local pc is windows, xclip is unnecessary.

Does the plugin "clipboard from local pc" support mac? I failed to do that with the error "Error: faild save image of clipboard". Although it do success on windows.

huiyeruzhou commented 1 year ago

Would you like to try my extension, here is the market:https://marketplace.visualstudio.com/items?itemName=dzylikecode.md-paste-enhanced

I installed your extension and found it to be very useful. I have a suggestion for improvement: have you considered adding a feature that supports automatically naming pasted images? This feature could automatically name the image based on selected text, and would be similar to the feature available in "paste image". The default naming format could therefore be improved, but it is sufficient for simple documents by now.

I also used the "paste from local pc" exension, but it appears to be outdated. Its handling of variables like ${currentFileDir} is confusing, and it cannot paste files correctly.