Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get 0 images when pasting image on Windows with Remote SSH #80

Closed
joaociocca opened this issue Nov 12, 2022 · 6 comments
Closed

Get 0 images when pasting image on Windows with Remote SSH #80

joaociocca opened this issue Nov 12, 2022 · 6 comments

Comments

@joaociocca
Copy link

The idea of your extension seemed perfect for the only functionality I feel is lacking on VS Code!

But when I try to paste a capture image (either with Alt+Shift+V or right-click > Paste Image), nothing happened.

I thought I'd then look on the VSCode Dev Tools and there it was: [Extension Host] Get 0 images workbench.desktop.main.js:87

image

When inspecting line 87, it shows the ondulated underline of an error:

image

Prettifying the code, the error seems to be on line 29860 of the workbench.desktop.main.js:

image

I'm not much of a programmer, but it seems the extension is using a Buffer() deprecated function? I tried to find this Buffer(), seems like there's only 2 occurences: line 51931 and line 246735

image

image

I'm running VS Code 1.73.1 on Windows 11 Pro 22H2 22621.819, but remoting into a Kali (based off Ubuntu, Linux kali 5.19.0-kali2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.19.11-1kali2 (2022-10-10) x86_64 GNU/Linux) session (which has xclip 0.13 installed).

Could this be related to the error I get when trying to run xclip in this session? I always get a Error: Can't open display: (null) message.

Any ideas on how to make it work?

@imlinhanchao
Copy link
Owner

Capture a image,and then execute this script https://github.com/imlinhanchao/vsc-markdown-image/blob/master/asserts/linux.sh like:

./linux.sh output.png 

Give me the output of command line,thks.

@joaociocca
Copy link
Author

joaociocca commented Nov 12, 2022

whoa, that was lightning fast. Hang on, gotta restore the VM.

Ok, grabbed the script, print in clipboard...

image

And, as expected, Error: Can't open display: (null)

@imlinhanchao
Copy link
Owner

I noticed you are using in a remote VM. Unfortunately, xclip requires an X desktop, so it won't work in a remote VM.

@joaociocca
Copy link
Author

joaociocca commented Nov 12, 2022

I followed some instructions from https://stackoverflow.com/questions/65468655/vs-code-remote-x11-cant-get-display-while-connecting-to-remote-server and got remote tmux to succesfully transfer content to my local clipboard

image

But when executing the linux.sh script you pointed to, all I get is a new error:

image

then I tried again and...

image

But it was only the text I had previously copied...

image

let's try again with the above image in the clipboard...

Yeah, no deal.

image

It's grabbing an even older content I copied from tmux (you can see it on the first print here)

(edit) I can definitely copy from remote and paste on local...

image

I forgot to mention that my tmux uses xclip - so here, plain and open piping text to xclip:

image

@joaociocca
Copy link
Author

New error: "Could not load markdown it plugin". I tried searching for this, but couldn't find it. I found two "markdown-it-*" related, but not simply "markdown-it".
image

The buffer warning seems to be a VS Code known issue, attempted to be fixed here, but still ongoing here.

@joaociocca
Copy link
Author

HA! Found out that the functionality is on experimental and already working actually! <3
microsoft/vscode#164843 (comment)

But thanks for developing this and for attempting to help me =) Keep being awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants