Skip to content

Windows: Bash tool spawns visible console windows that steal focus #40334

Closed as duplicate

Description

@ChrisAi-code

Summary

On Windows 11, every time Claude Code executes the Bash tool, it spawns /usr/bin/bash --login -i as a visible console window. This window steals focus from whatever the user is working in, interrupting their workflow.

Steps to Reproduce

  1. Use Claude Code on Windows 11 with Git Bash installed
  2. Ask Claude to run any bash command (file read, git operation, test run, etc.)
  3. A console window appears and steals focus from the active application

Expected Behavior

Bash processes spawned internally by Claude Code should run with CREATE_NO_WINDOW (or equivalent) so they are invisible to the user.

Actual Behavior

A visible /usr/bin/bash --login -i console window appears for every Bash tool call, stealing focus from the user's current application. For agentic sessions with many tool calls, this means dozens of windows flashing up and interrupting work continuously.

Environment

  • OS: Windows 11 Pro
  • Shell: Git Bash (/usr/bin/bash)
  • Claude Code: Desktop app

Workaround Attempted

None effective. The issue is at the process creation level — Claude Code needs to pass CREATE_NO_WINDOW (0x08000000) or STARTF_USESHOWWINDOW with SW_HIDE when spawning bash processes on Windows.

Impact

High — makes Claude Code very disruptive to use on Windows when running agentic tasks with multiple tool calls.

Activity

  1. github-actions commented on Mar 28, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. Windows: Bash tool spawns visible console windows that steal focus #40335
    2. Windows: Bash commands spawn visible black console windows #28138
    3. [BUG] [Windows] Console window flashes on every Bash tool execution #16880

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. added
    duplicateThis issue or pull request already exists
    and removed
    bugSomething isn't working
    has reproHas detailed reproduction steps
    platform:windowsIssue specifically occurs on Windows
    on Apr 1, 2026
  3. github-actions commented on Apr 1, 2026

    @github-actions

    This issue has been automatically closed as a duplicate of #40335.

    If this is incorrect, please re-open this issue or create a new one.

    🤖 Generated with Claude Code

  4. github-actions commented on Apr 9, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  5. locked as resolved and limited conversation to collaborators on Apr 9, 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

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions