Skip to content

Windows: every tool call opens a new visible PowerShell/cmd window #7895

Open

Description

@gfsaaser24

What happens

On Windows, the desktop app opens a new PowerShell or cmd window each time the agent makes a tool call that runs a shell command. A normal agent run leaves a pile of console windows popping up and stealing focus.

Why

The desktop app is a GUI process. When a GUI process starts a console program (powershell.exe, cmd.exe, npx.cmd, etc.) with std::process::Command, Windows gives the child its own visible console window unless the CREATE_NO_WINDOW creation flag is set. The shell tool (and likely stdio MCP server launches and any other spawned helpers) doesn't seem to set it.

macOS and Linux don't have this behavior, which is probably why it hasn't shown up there.

Fix

Set the flag on every Command spawned on Windows:

#[cfg(windows)]
{
    use std::os::windows::process::CommandExt;
    cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
}

For tokio::process::Command, the same creation_flags method is available on Windows.

A shared helper that builds every child process would catch all spawn sites at once (shell tool, MCP stdio servers, git, ripgrep, etc.).

Workaround for now

Running the terminal/headless build from an existing terminal avoids it, since children inherit that console. Docker sandbox mode or WSL also avoids it.

Related

#4705 (Windows shell tool defaulting to bash)

Activity

  1. added
    priority: p2Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.
    on Oct 16, 2026
  2. tinysweeper commented on Oct 16, 2026

    @tinysweeper

    On Windows, every shell tool call (and likely other spawned processes) opens a visible console window because GUI processes must set the CREATE_NO_WINDOW creation flag when spawning children. Fix is to set creation_flags(0x08000000) on all Command spawns, ideally via a shared helper. Annoying UX bug with a workaround (run from a terminal), so p2.

    Labelled priority: p2.

  3. added theissue type on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions