gitextensions icon indicating copy to clipboard operation
gitextensions copied to clipboard

Scripts: How to escape paths for command line

Open mstv opened this issue 7 months ago • 2 comments

Before the changes were made for SelectedFiles to return a blob path rather than full-path I've been making changes so I could concat/replace/etc these variables via "Run on PowerShell" option and one of the problems I ran into is that this kind of escaping did not work.

So I went to see how ProcessStartInfo does it and it was different than current method. When I changed current method to what's used in the BCL, then the test-cases for WSL and Windows became identical. Could you look at this commit to see what I mean: https://github.com/mdonatas/gitextensions/commit/768ca88c37ca98ef17e448db6656031eab9718c5

Basically I think we can unify these two methods esp. given that current method did not work when running with PowerShell mode.

Originally posted by @mdonatas-trafi in https://github.com/gitextensions/gitextensions/issues/11795#issuecomment-2198549641

mstv avatar Jun 30 '24 14:06 mstv