Skip to content

fix(windows): console window flashes on child process spawns #537

Description

@Raymond8196

Description

On Windows, the GUI host binary is built with #![windows_subsystem = "windows"], so it has no console of its own. Any console-subsystem child process it spawns allocates and briefly flashes a brand-new console window. Three spawn sites in the codebase were missing the CREATE_NO_WINDOW flag that the rest of the Windows spawn paths already use:

  • whoami in app-paths::current_windows_account_for_acl — hit on every sensitive-file permission write (key save, token refresh, first-launch install_id).
  • The bundled Peekaboo CLI in agent-core (screenshot / accessibility tool).
  • taskkill in benchmark::process::terminate_process.

Because some of these fire on a timer or in bursts, the user perceives terminal windows that "keep popping out".

Steps to Reproduce

  1. On Windows, run the packaged GUI app.
  2. Trigger any of the above paths — e.g. save a credential / refresh a token (whoami), take a screenshot via the bundled Peekaboo CLI, or run a benchmark that terminates a process via taskkill.
  3. Observe a console window flashing briefly each time.

Expected Behavior

No console window is ever shown for these background child processes.

Actual Behavior

A console window flashes on screen for each invocation.

Environment

  • OS: Windows (any supported version; app built as windows_subsystem = "windows")

Additional Context

The flag CREATE_NO_WINDOW and helper app_platform::hide_console already exist and are used at sibling sites (sidecar_setup.rs, kiro.rs, lifecycle.rs, session.rs, env_setup.rs). This just closes the remaining gaps with the same pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions