vscode-paste-image icon indicating copy to clipboard operation
vscode-paste-image copied to clipboard

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

Open mosh-shu opened this issue 5 years ago • 13 comments

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

  • Windows 10
  • VS Code with Remote WSL

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?

mosh-shu avatar Jan 18 '20 01:01 mosh-shu

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.

heyzling avatar Jan 18 '20 07:01 heyzling

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 avatar Jan 21 '20 18:01 spottedmahn

It seems, API methods work only with text content.

Nvm, found it Clipboard API 😀

image

spottedmahn avatar Jan 21 '20 18:01 spottedmahn

It could be workaround.

  • Make sure you have xclip installed as plugin suggests (sudo apt install xclip).
  • Run and configure X server like X410 or so and make sure your apps can connect to it (xclock, for example, can show a clock window).
  • Make sure your X server has "shared clipboard" feature.

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.

snt avatar Mar 03 '20 07:03 snt

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.

sakamoto66 avatar Aug 28 '20 05:08 sakamoto66

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.

DigitalMarc avatar Sep 02 '20 10:09 DigitalMarc

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

sakamoto66 avatar Sep 02 '20 22:09 sakamoto66

@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

DigitalMarc avatar Sep 03 '20 07:09 DigitalMarc

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

  • plan A [vscode on windows10] ---(SSH)--->[Ubuntu 20 on virtualbox VM]

  • plan B [windows10] ---(virtualbox console)--->[vscode on Ubuntu 20 on virtualbox VM]

sakamoto66 avatar Sep 03 '20 10:09 sakamoto66

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.

vezaynk avatar Dec 25 '21 05:12 vezaynk

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

dzylikecode avatar Oct 05 '22 17:10 dzylikecode

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.

ZhangSIming-blyq avatar Jan 30 '23 03:01 ZhangSIming-blyq

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.

huiyeruzhou avatar May 08 '23 14:05 huiyeruzhou