-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Process.start incorrect args double quote escaping #50076
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
Comments
//cc @derekxu16 |
@danielchim I'm not able to reproduce this locally. Can you please answer the following questions so I can investigate further?
Thanks! |
@derekxu16 The issue happens regardless of |
@danielchim Can you please try the two workarounds listed here and let me know if they work? Can you try them once with
Since these are just workarounds, I also have a few more questions that will help me investigate why your original code doesn't work.
Thanks! |
@derekxu16 Here are the results: tl;dr: Method 1 with setting Method 1 code:
Method 1, with The log can't even reach to the launch parameter stage. Method 1, with It works as expected. (I stopped the recording, but the game launches as expected.) Game log output:
There are no quote escaping! 🥳 Method 2 code:
Method 2, with Game log output:
Method 2, with Game log output:
I am using IntelliJ IDEA Ultimate 2021.3.3 with flutter + dart plugin, and I am using the run button on the IDE. I am using Windows 11 22H1/22H2 professional workstation edition x64. Also before the workaround proposed by derek, here's how I made it work in flutter with the help of
Hope this helps someone who encounters a similar issue. I also discovered an issue that has a similar discussion at #42571. P.S Something noteworthy is when you add one single escape character in the double quotes, it won't add extra double quotes, until and add one more escape character looks like this: And the logs be like:
|
I believe that the only guarantee we make is that a C program started with sdk/sdk/lib/_internal/vm/bin/process_patch.dart Lines 349 to 350 in 3602351
To ensure this, we have to process the arguments passed into So, I'd say |
This dart code should start an app (a.exe for example) with a json as a string:
However, when I check the log in the a.exe, I find out that it will include escape characters automatically:
This caused the app to crash.
The expected behavior should be:
Edit: With json and json.encode the same issue happened. I assume
Process.run()
will encode the double quotes with escape character as the same issue will not occurred with other languages when passing the same arguments.The text was updated successfully, but these errors were encountered: