Skip to content

Commit f6cd919

Browse files
committed
fix: prevent the popup of terminal Windows on any command invocation.
1 parent 087594c commit f6cd919

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

gix-command/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,13 @@ mod prepare {
237237
} else {
238238
Command::new(prep.command)
239239
};
240+
// We never want to have terminals pop-up on Windows if this runs from a GUI application.
241+
#[cfg(windows)]
242+
{
243+
use std::os::windows::process::CommandExt;
244+
const CREATE_NO_WINDOW: u32 = 0x08000000;
245+
cmd.creation_flags(CREATE_NO_WINDOW);
246+
}
240247
cmd.stdin(prep.stdin)
241248
.stdout(prep.stdout)
242249
.stderr(prep.stderr)
@@ -401,6 +408,8 @@ pub mod shebang {
401408
/// - `stdout` is captured for consumption by the caller
402409
/// - `stderr` is inherited to allow the command to provide context to the user
403410
///
411+
/// On Windows, terminal Windows will be suppressed automatically.
412+
///
404413
/// ### Warning
405414
///
406415
/// When using this method, be sure that the invoked program doesn't rely on the current working dir and/or

0 commit comments

Comments
 (0)