Clarify CREATE_NO_WINDOW console behavior in os_term comment
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2026-09-01 12:42:33 +02:00
parent dfe0bf19e3
commit 8142ec08a0

View file

@ -3151,6 +3151,17 @@ pid_t os_wait(pid_t pid, int* status)
* process with no console support. For a console application it provides a
* windowless console, so the process can still receive console control events.
*
* Note that the Microsoft documentation is somewhat ambiguous here: it says
* that with CREATE_NO_WINDOW "the console handle for the application is not
* set", which can be misread as meaning that the process has no console at all.
* In practice, CREATE_NO_WINDOW creates a console session without a visible
* console window, and is distinct from DETACHED_PROCESS, which creates a
* process with no attached console.
*
* This behavior is documented and experimentally verified here:
* https://learn.microsoft.com/en-us/windows/win32/procthread/process-creation-flags
* https://github.com/rprichard/win32-console-docs
*
* CREATE_NEW_PROCESS_GROUP creates a new process group whose identifier is
* the process ID of the child created by CreateProcess(). This allows
* CTRL_BREAK_EVENT to be directed specifically to the child's process group: