Skip to main content

Module process

Module process 

Source
Expand description

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.

Constants§

CREATE_NO_WINDOW
CREATE_NO_WINDOW: the child runs without a console window.

Functions§

hide_console_windows
From now on hide_window starts programs without a console window. For GUI processes (the app), called once before anything is started.
hide_window
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.
hiding_console_windows
True once hide_console_windows was called in this process.