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
//! Starting other programs from the app without a console window (#41).
//!
//! The app is a GUI process: on Windows every console program it starts
//! (git, `op`, taskkill, ...) gets a console window of its own unless the
//! spawn sets `CREATE_NO_WINDOW`. Every `Command` that core or the app
//! starts goes through [`hide_window`]; a test
//! (`tests/no_console_window.rs`) keeps it that way.
//!
//! Hiding is opt-in per process: the app calls [`hide_console_windows`]
//! once at start-up. The CLI never does, so the git and `op` it starts
//! keep its console: an ssh prompt reaches the user's terminal and Ctrl+C
//! reaches git.
use Command;
use ;
/// `CREATE_NO_WINDOW`: the child runs without a console window.
pub const CREATE_NO_WINDOW: u32 = 0x0800_0000;
static HIDE: AtomicBool = new;
/// From now on [`hide_window`] starts programs without a console window.
/// For GUI processes (the app), called once before anything is started.
/// True once [`hide_console_windows`] was called in this process.
/// Starts `command` without a console window on Windows once this process
/// called [`hide_console_windows`]; otherwise (the CLI, other OSes) it
/// does nothing and the child shares the parent's console.