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 window, detached from the parent’s console.
Functions§
- current_
user_ identity - Current user SID (
S-1-5-…) andDOMAIN\Userfor Task Scheduler XML. Empty strings on non-Windows. - 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.
- relaunch_
elevated - Re-launch this process elevated via UAC (
runas). Returns after the elevated process exits, or an error if the user declines / API fails. - set_
creation_ flags - OR
flagsinto the command’s Windows creation flags.