telesoho / vscode-markdown-paste-image

Smartly paste for Markdown.
MIT License
136 stars 41 forks source link

WSL not working properly? #88

Open monologconnor opened 2 years ago

monologconnor commented 2 years ago

Hi! there!

I just found this extension and I'm pretty appreciate that since I'm looking for the image pasting extension supporting WSL like this for a long time.

However, I have just tested the extension, and I found the extension is actually not working properly to me.

My environment is WSL2 under Windows 11, my procedure and behavior of the extension is like:

I wonder if this is due to my wrong configuration since I have not seen anyone experienced similar issue...

Thanks for your help.

telesoho commented 2 years ago

@monologconnor

I don't use WSL2 and Windows. Maybe @knyzorg can help you.

vezaynk commented 2 years ago

That's the same procedure I have!

Needing to wait 15 seconds is pretty crazy, but unsurprising. This extension works by running shell scripts, which can only run after your shell is ready for input. Mine is pretty slow. I have oh-my-zsh and a bunch of plugins, WSL's I/O is notoriously slow on top of that.

I haven't used the extension since a month or two, so this might be a regression.

I have been doing exploratory work in how we can access the clipboard image data without needing shell scripts, and this is the best I could come up with so far: https://github.com/knyzorg/node-clipboard-wd

I haven't gotten around to making a demo branch yet, but once I do, it might fix everything.

I've been delaying doing so hoping that vscode addresses my request for clipboard API parity with electron but I haven't seen much movement. Another issue is that my method has an annoying limitation that forces the puppeteer process to run in the foreground, showing up in the taskbar: https://github.com/puppeteer/puppeteer/issues/7888

I'll try to get to it this weekend and the we will have at least one branch that will work reliability.

monologconnor commented 2 years ago

That's the same procedure I have!

Needing to wait 15 seconds is pretty crazy, but unsurprising. This extension works by running shell scripts, which can only run after your shell is ready for input. Mine is pretty slow. I have oh-my-zsh and a bunch of plugins, WSL's I/O is notoriously slow on top of that.

I haven't used the extension since a month or two, so this might be a regression.

I have been doing exploratory work in how we can access the clipboard image data without needing shell scripts, and this is the best I could come up with so far: https://github.com/knyzorg/node-clipboard-wd

I haven't gotten around to making a demo branch yet, but once I do, it might fix everything.

I've been delaying doing so hoping that vscode addresses my request for clipboard API parity with electron but I haven't seen much movement. Another issue is that my method has an annoying limitation that forces the puppeteer process to run in the foreground, showing up in the taskbar: puppeteer/puppeteer#7888

I'll try to get to it this weekend and the we will have at least one branch that will work reliability.

Thanks for @telesoho 's and your reply!

My problem currently is not only crazy waiting period but also the image saved in the path does not contain any data. (Data did not captured correctly from the clipboard I guess?)

But nevermind, I'm currently accessing WSL directory with local vscode rather than WSL remote, so I could still use this extension as normal. So don't feel too stressed.

Anyway thanks for your help and I'm looking forward to your update!

newzealandpaul commented 2 years ago

My problem currently is not only crazy waiting period but also the image saved in the path does not contain any data. (Data did not captured correctly from the clipboard I guess?)

I am not experiencing the waiting time, but the images are zero length.

ngmariusz commented 2 years ago

i have the same;

dzylikecode commented 2 years ago

I have the same problem. It's a little hard for me to read all the source files and I'm unfamiliar with typescript. So I just wrote a new tiny extension focusing on making it work well on WSL and Windows. Here is the repository: https://github.com/dzylikecode/Inspire-VSCodeExt-Paste-Image