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

Don't show console on Windows #1075

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/cred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,12 @@ impl CredentialHelper {
// If that fails then it's up to the user to put `sh` in path and make
// sure it works.
let mut c = Command::new("sh");
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x08000000;
c.creation_flags(CREATE_NO_WINDOW);
}
c.arg("-c")
.arg(&format!("{} get", cmd))
.stdin(Stdio::piped())
Expand All @@ -384,6 +390,12 @@ impl CredentialHelper {
debug!("`sh` failed to spawn: {}", e);
let mut parts = cmd.split_whitespace();
let mut c = Command::new(parts.next().unwrap());
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x08000000;
c.creation_flags(CREATE_NO_WINDOW);
}
for arg in parts {
c.arg(arg);
}
Expand Down