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.

Does Not Work With Remote-WSL Extension

See original GitHub issue

Hello! This extension doesn’t work out of the box with the Windows Subsystem for Linux extension suite. I am using VScode 1.48, windows 10, WSL & the Remote - WSL extension.

I believe the issue is that this extension, by default, tries to force you to run it on the wsl-remote side which does not have access to the windows clipboard.

I was able to fix the issue by adding this to settings.json:

"remote.extensionKind": {
        "telesoho.vscode-markdown-paste-image": ["ui"],
    }

This forces the extension to run on the UI/Windows side where it has access to the windows clipboard.

This could be fixed by setting vscode-markdown-paste-image to run on the ui/windows side by default when remote extensions are installed.

In the meantime, the above local fix works for wsl if anyone else is having the same issue.

[EDIT: after experimenting with it a bit more, it doesn’t actually work, even with this fix. Changing the settings.json so it runs on the ui side lets you access the clipboard. But it does not actually save the image file that you create.]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
RyanPerssoncommented, Aug 30, 2020

When Running wsl-remote. I create an image in the windows clipboard using the screen snipping tool.

When I try to paste that image into a markdown file via Ctrl+Alt+V, the UI takes me through the options for saving/pasting an image. It allows me to name the filepath & then creates an image style link. When I navigate to where the image is supposed to be, vscode says “an error occured while loading this image.” & navigating to the directory through any other file explorer shows that no image file was actually created.

I’ve attached a screenshot of the console output as you requested as well as vscode trying to view the image.

image

image

I think that you are correct that the extension doesn’t correctly get the image clipboard contents in WSL. The extension works correctly when I use it without WSL

0reactions
JeffersonQincommented, Aug 1, 2021

Well, to me, I think the problem of SSH and WSL are different. For WSL, you still have access to Windows through bash, because you can evoke powershell.exe or cmd.exe (etc.) to access Windows, which is your editing environment. However, in the case of SSH, the extensions can only access the target environment, but not the host environment (editing environment).

And to implement the functionalities for WSL, we have to separate it into two steps:

  • check whether the environment is WSL. This can be done by packages such as isWsl
  • execute windows batch files / powershell files through shell

I have added the similar support in another project: https://github.com/PicGo/PicGo-Core/pull/87

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developing in WSL - Visual Studio Code
When VS Code Remote is started in WSL, no shell startup scripts are run. This was done to avoid issues with startup scripts...
Read more >
VSCode + remote WSL some functions not working
When opening a WSL remote connection and clicking on Extensions, VS Code shows "Local - Installed" and "WSL: UBUNTU - Installed". The Local ......
Read more >
Cannot start vscode in WSL · Issue #6294 - GitHub
Open Extensions and then search on remote - SSH 3. It should say switch to pre-released version , click and reload. They fixed...
Read more >
Get started using VS Code with WSL - Microsoft Learn
We do not recommend using WSL in VS Code without the WSL extension as you will lose support for auto-complete, debugging, linting, etc....
Read more >
VS Code tips — The Remote WSL extension - YouTube
Today's VS Code extension : Remote WSLSeamlessly connect your Windows VS Code instance to the Windows ... Your browser can't play this video....
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