1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Hide the console window of a child you build yourself (`std::process::Command`, and
//! `tokio::process::Command` with the `tokio` feature), without going through
//! [`OwnedCommand`](crate::OwnedCommand).
/// The Windows `CREATE_NO_WINDOW` creation flag, exposed on every platform so a caller that
/// composes its own flags can OR it in.
pub const CREATE_NO_WINDOW: u32 = 0x0800_0000;
/// The Windows `CREATE_BREAKAWAY_FROM_JOB` creation flag, exposed on every platform so a caller
/// that composes its own flags (for example a deliberately detached replacement process) can OR
/// it in. It asks the new process to leave the creator's job object; the launch fails with
/// access denied when that job forbids breakaway.
pub const CREATE_BREAKAWAY_FROM_JOB: u32 = 0x0100_0000;
/// A `std::process::Command` for `program` that already has the no-window flag set on Windows,
/// returned by value so it chains: `command_std("git").args(["status"]).output()`. Same effect as
/// `Command::new(program)` followed by [`NoWindow::no_window`]; on Unix the child also inherits
/// no descriptor above stderr (see `SanitizeDescriptors`; pass
/// descriptors with a later `sanitize_descriptors(&[fd])`). The async variant is
/// `tokio_support::command` (feature `tokio`).
/// Suppresses the child's console window on Windows. A no-op elsewhere.
///
/// On Windows this calls `creation_flags(CREATE_NO_WINDOW)`, which *replaces* any creation
/// flags set earlier on the same command (that is how `creation_flags` works for both std and
/// tokio). Call it first and OR any further flags yourself with [`CREATE_NO_WINDOW`], or call
/// `creation_flags(CREATE_NO_WINDOW | other)` directly.