telesoho / vscode-markdown-paste-image

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

Wrap arguments in quotes #62

Closed vezaynk closed 2 years ago

vezaynk commented 2 years ago

Fix for paths with spaces

manuth commented 2 years ago

As opposed to #61, wrapping options with " will break paths containing " (which surprisingly is allowed on Linux). I'd recommend closing this PR in favor of PR #61 that I have created some seconds ago.

vezaynk commented 2 years ago

which surprisingly is allowed on Linux

Good point. That is surprising.

vezaynk commented 2 years ago

Could you give this branch a try? @manuth

manuth commented 2 years ago

I'm about to Sadly, these changes break the runCommand method. This is the args variable I get: -noprofile -noninteractive -nologo -sta -executionpolicy unrestricted -windowstyle hidden -file e:\\Users\\Manuel\\Documents\\Projects\\VSCode-Extensions\\vscode-markdown-paste-image\\res\\win32_save_clipboard_png.ps1 c:\\Temp\\This\ is\ a\ test\\2021-12-29-21-32-06.png

That said - escaping whitespaces using \ doesn't work on Powershell (iirc).

On Linux it's working fine.