Skip to content

Commit 8471723

Browse files
authored
Merge pull request #1075 from sheremetyev/hide-console-windows
Don't show console on Windows
2 parents abbd64e + 4e763c7 commit 8471723

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/cred.rs

+12
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,12 @@ impl CredentialHelper {
372372
// If that fails then it's up to the user to put `sh` in path and make
373373
// sure it works.
374374
let mut c = Command::new("sh");
375+
#[cfg(windows)]
376+
{
377+
use std::os::windows::process::CommandExt;
378+
const CREATE_NO_WINDOW: u32 = 0x08000000;
379+
c.creation_flags(CREATE_NO_WINDOW);
380+
}
375381
c.arg("-c")
376382
.arg(&format!("{} get", cmd))
377383
.stdin(Stdio::piped())
@@ -384,6 +390,12 @@ impl CredentialHelper {
384390
debug!("`sh` failed to spawn: {}", e);
385391
let mut parts = cmd.split_whitespace();
386392
let mut c = Command::new(parts.next().unwrap());
393+
#[cfg(windows)]
394+
{
395+
use std::os::windows::process::CommandExt;
396+
const CREATE_NO_WINDOW: u32 = 0x08000000;
397+
c.creation_flags(CREATE_NO_WINDOW);
398+
}
387399
for arg in parts {
388400
c.arg(arg);
389401
}

0 commit comments

Comments
 (0)