-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking Issue for windows_process_extensions_raw_arg #92939
Comments
I need a Rust team member to kick off an FCP for this. |
@rfcbot merge |
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
If I have a string containing a full command (e.g. I want to have something that behaves as if I passed that string to Running Having to split off the first part of |
@nico this API can’t help you accomplish that. In order to accomplish that you need a null value passed for lpApplicationName, which isn’t supported by std::process::Command. You’re probably best served by calling CreateProcessA directly at that point. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
stabilize windows_process_extensions_raw_arg Stabilizes the feature tracked at rust-lang#92939
Triage: I'm going to close this as the stabilization PR was merged already 🎉 |
stabilize windows_process_extensions_raw_arg Stabilizes the feature tracked at rust-lang/rust#92939
Feature gate:
#![feature(windows_process_extensions_raw_arg)]
This is a tracking issue for the raw_arg extension to
std::process::Command
on Windows.Windows programs on the lowest API layers actually aren't required to accept arguments as an array of strings.
In fact the illusion that they do accept arguments as an array of strings is mostly maintained by one function. CommandLineToArgvW. Not all programs use that function to parse arguments. Some of the programs that don't do this are really important, like
cmd.exe
. These programs instead read their argument as one large string, which makes them incompatible with howstd::process::Command::arg
passes the arguments.std::process::Command::arg
assumes the program will parse the string usingCommandLineToArgvW
. Most of the time this is a reasonable assumption to make.Solution:
raw_arg
. Strings passed viaraw_arg
are sent straight through with no alteration, save for inserting spaces inbetween them. Raw args are not quoted, escaped, or really anything complicated like that. This makes them compatible with Windows executable files which don't use CommandLineToArgvW.Public API
Steps / History
Unresolved Questions
The text was updated successfully, but these errors were encountered: