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

Tracking Issue for expose force_quotes in CommandExt on Win32 #82227

Open
1 of 3 tasks
lygstate opened this issue Feb 17, 2021 · 0 comments
Open
1 of 3 tasks

Tracking Issue for expose force_quotes in CommandExt on Win32 #82227

lygstate opened this issue Feb 17, 2021 · 0 comments
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC O-windows Operating system: Windows T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@lygstate
Copy link
Contributor

lygstate commented Feb 17, 2021

Feature gate: #![feature(windows_process_extensions_force_quotes)]

This is a tracking issue for expose force_quotes in CommandExt on Win32

Forces all arguments to be wrapped in quote (") characters.

This is useful for passing arguments to MSYS2/Cygwin based
executables: these programs will expand unquoted arguments containing
wildcard characters (? and *) by searching for any file paths
matching the wildcard pattern.

Adding quotes has no effect when passing arguments to programs
that use msvcrt. This includes programs built with both
MinGW and MSVC.

Public API

// std::process

pub trait CommandExt: Sealed {
    #[unstable(feature = "windows_process_extensions_force_quotes", issue = "82227")]
    fn force_quotes(&mut self, enabled: bool) -> &mut process::Command;
}

Steps / History

Unresolved Questions

  • None yet.
@lygstate lygstate added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Feb 17, 2021
@m-ou-se m-ou-se added the O-windows Operating system: Windows label Feb 17, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 17, 2021
Expose force_quotes on Windows.

On Windows, the arg quotes and not quotes have different effect
for the program it called, if the program called are msys2/cygwin program.
Refer to
msys2/MSYS2-packages#2176

This also solve the issues comes from

https://internals.rust-lang.org/t/std-process-on-windows-is-escaping-raw-literals-which-causes-problems-with-chaining-commands/8163

Tracking issue:
rust-lang#82227
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC O-windows Operating system: Windows T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants