Skip to content

Commit

Permalink
Merge pull request #1075 from sheremetyev/hide-console-windows
Browse files Browse the repository at this point in the history
Don't show console on Windows
  • Loading branch information
ehuss authored Oct 26, 2024
2 parents abbd64e + 4e763c7 commit 8471723
Showing 1 changed file with 12 additions and 0 deletions.
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

0 comments on commit 8471723

Please sign in to comment.