Skip to content

Commit 47ed1c3

Browse files
committed
docs: Clarify CREATE_NO_WINDOW usage
1 parent 9894c89 commit 47ed1c3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

git2-hooks/src/hookspath.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,16 @@ fn find_default_unix_shell() -> Option<PathBuf> {
203203
}
204204

205205
trait CommandExt {
206+
/// The process is a console application that is being run without a
207+
/// console window. Therefore, the console handle for the application is
208+
/// not set.
209+
///
210+
/// This flag is ignored if the application is not a console application,
211+
/// or if it used with either `CREATE_NEW_CONSOLE` or `DETACHED_PROCESS`.
212+
///
213+
/// See: https://learn.microsoft.com/en-us/windows/win32/procthread/process-creation-flags
214+
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
215+
206216
fn with_no_window(&mut self) -> &mut Self;
207217
}
208218

@@ -216,7 +226,7 @@ impl CommandExt for Command {
216226
#[cfg(windows)]
217227
{
218228
use std::os::windows::process::CommandExt;
219-
self.creation_flags(0x0800_0000);
229+
self.creation_flags(Self::CREATE_NO_WINDOW);
220230
}
221231

222232
self

0 commit comments

Comments
 (0)