Skip to content

Suppress console window for llama.cpp runtime on Windows - #265

Merged
thomas9120 merged 3 commits into
betafrom
main
Jul 29, 2026
Merged

Suppress console window for llama.cpp runtime on Windows#265
thomas9120 merged 3 commits into
betafrom
main

Conversation

@thomas9120

Copy link
Copy Markdown
Owner

Sync

GiuseppeCapaldo93 and others added 3 commits July 28, 2026 15:43
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
thomas9120 marked this pull request as ready for review July 29, 2026 12:24
@thomas9120
thomas9120 merged commit bed8c68 into beta Jul 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants