Suppress console window for llama.cpp runtime on Windows - #265
Merged
Conversation
On Windows the long-running llama.cpp runtime is launched as a console
application. When the GUI runs detached (pythonw, or the restart handoff)
that gives the child a brand-new, visible console window that flashes on the
desktop.
Hide that window via STARTUPINFO (STARTF_USESHOWWINDOW + SW_HIDE) while keeping
creationflags at CREATE_NEW_PROCESS_GROUP. This deliberately does not use
CREATE_NO_WINDOW: that flag severs the console entirely, which would stop
CTRL_BREAK_EVENT from reaching a console-attached parent's child and break the
existing graceful-stop path. STARTUPINFO hides a newly created console window
without clearing the inherited console association, so a console-attached parent
keeps working graceful stop.
For a console-less parent (pythonw/detached) CTRL_BREAK_EVENT raises OSError
("The handle is invalid"); _request_graceful_stop now reports that failure so
_stop_process_locked falls back to kill() instead of leaving the runtime
running. The short-lived probes keep using get_no_window_creationflags().
Tests verify that the runtime launch requests SW_HIDE, that creationflags is
exactly CREATE_NEW_PROCESS_GROUP, and that a failed stop signal still falls back
to kill(); the flag/startupinfo values are injected so the win32 branch is
exercised on every platform.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add Nebula theme and clipped card hover gradients
…-window Suppress console window when launching the llama.cpp runtime
thomas9120
marked this pull request as ready for review
July 29, 2026 12:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sync