don't show a console when running git.exe on windows

This commit is contained in:
Josh Junon 2024-03-22 01:34:24 +01:00
parent 29a9e18b66
commit 3e41872591
No known key found for this signature in database

View File

@ -61,6 +61,15 @@ unsafe impl super::GitExecutor for TokioExecutor {
cmd.args(args);
cmd.current_dir(cwd);
#[cfg(windows)]
{
// On windows, CLI applications that aren't the `windows` subsystem
// will create and show a console window that pops up next to the
// main application window when run. We disable this behavior when
// running `git.exe` by setting the `CREATE_NO_WINDOW` flag.
cmd.creation_flags(0x0800_0000); // CREATE_NO_WINDOW
}
if let Some(envs) = envs {
cmd.envs(envs);
}