Skip to content

fix(ai): hide console windows for AI CLI processes on Windows - #819

Merged
Xoshbin merged 1 commit into
Xoshbin:mainfrom
fhalim:fix/windows-ai-cli-no-window
Oct 4, 2026
Merged

Xoshbin merged 1 commit into
Xoshbin:mainfrom
fhalim:fix/windows-ai-cli-no-window

Conversation

@fhalim

@fhalim fhalim commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On Windows, the GUI process spawns console-subsystem AI CLI children, and each one flashes a visible console window: the where binary lookup, the --version check, the models listing, the chat spawn, and the codex app-server. It steals focus from the asyar window.

Fix

Add ai::cli::hide_console_window, which sets CREATE_NO_WINDOW on Windows and is a no-op elsewhere, and apply it at each spawn site in cli.rs, codex_client.rs and models.rs. The std::process::Command used for where sets the flag inline since the helper takes a tokio Command.

Verification

  • Built and ran a debug build on Windows 11.
  • Validated that a claude CLI session works without a window popping up for it.

GUI-launched AI CLI children (the `where` lookup, `--version` and
`models` probes, chat spawn, and the codex app-server) opened a visible
console window on Windows. Spawn them with CREATE_NO_WINDOW via a shared
hide_console_window helper.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X7kyDQbaNWvTgH2fSHKwAK
@fhalim
fhalim marked this pull request as ready for review October 4, 2026 17:51
@Xoshbin
Xoshbin merged commit 9d41426 into Xoshbin:main Oct 4, 2026
7 checks passed
@Xoshbin

Xoshbin commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Thank you 🙏

Xoshbin pushed a commit that referenced this pull request Nov 18, 2026
Stdio MCP servers were spawned without CREATE_NO_WINDOW, so on Windows each
`npx`/`uvx`-style server (a console-subsystem program or a `.cmd` shim run
via cmd.exe) opened a visible console window. Reuse the hide_console_window
helper added for the AI CLI processes in #819.
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