Expand description
Windows process-creation helpers for non-PTY children.
PTY / ConPTY spawns must keep a console; everything else (ACP, app-server, m4a-agent, spawn profiles, probes, schtasks, powershell helpers) must not pop a visible window. Closing a console must not kill a supervised node.
Constants§
- CREATE_
NEW_ PROCESS_ GROUP CREATE_NEW_PROCESS_GROUP(0x00000200).- CREATE_
NO_ WINDOW CREATE_NO_WINDOW(0x08000000). Safe to OR with other creation flags.- DETACHED_
PROCESS DETACHED_PROCESS(0x00000008) — no console inheritance.- HEADLESS_
SPAWN_ FLAGS - Flags for a headless node / child: no console at all (DETACHED_PROCESS), own process group. CREATE_NO_WINDOW is left out: with DETACHED_PROCESS it is ignored, and on its own it still creates a (hidden) console that can flash.
Functions§
- free_
console - Detach this process from its console (if any). No-op on non-Windows.
- hide_
console - Apply
CREATE_NO_WINDOWon Windows. No-op elsewhere. Does not touch program, args, env, cwd, or stdio. Call once: a secondcreation_flagsreplaces the previous value — useset_creation_flagsto OR. - hide_
console_ detached - Spawn flags for the supervised child node (no console, detached).
- hide_
console_ tokio - Same for tokio’s command (via
as_std_mut). - ignore_
console_ close_ events - Ignore CTRL_CLOSE / CTRL_LOGOFF / CTRL_SHUTDOWN so closing a terminal that somehow still owns us does not kill a supervised node. CTRL_C still works for interactive CLI. No-op on non-Windows.
- set_
creation_ flags - OR
flagsinto the command’s Windows creation flags.