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

Scripts: How to escape paths for command line #11798

Open
mstv opened this issue Jun 30, 2024 · 2 comments
Open

Scripts: How to escape paths for command line #11798

mstv opened this issue Jun 30, 2024 · 2 comments

Comments

@mstv
Copy link
Member

mstv commented Jun 30, 2024

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: mdonatas@768ca88

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 #11795 (comment)

@mstv
Copy link
Member Author

mstv commented Jun 30, 2024

@mdonatas, please come to an agreement with @SlugFiller. I do not have a strong opinion myself because I hardly encounter files which need escaping.

@SlugFiller
Copy link
Contributor

The version I made is based on my experiments on what actually executes, e.g. when passed as parameter to cmd /c. If the patch checks out in practice (i.e. Executing with System.Diagnostics.Process), then I have no nitpicks about the specifics of the escaped output.

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