Windows: console windows flash when extension spawns child processes

Resolved 💬 3 comments Opened Mar 27, 2026 by landon-homeriz Closed Mar 30, 2026

Description

On Windows 11, the Claude Code VS Code extension spawns child processes (gh.exe, bash.exe, python.exe, etc.) without setting windowsHide: true in the Node.js child_process.spawn() options. This causes visible console windows to flash on screen, stealing keyboard focus and interrupting the user's typing.

Environment

  • Windows 11 Home (10.0.26200)
  • VS Code (latest)
  • Claude Code extension (latest)

Steps to Reproduce

  1. Open VS Code on Windows with Claude Code extension active
  2. Start a Claude Code session
  3. Observe console windows flashing periodically (especially for gh.exe and bash.exe calls)

The windows appear briefly and steal focus, interrupting whatever the user is typing. Some processes (like MCP servers) create persistent console windows that remain open.

Expected Behavior

Child processes should be spawned with windowsHide: true in the child_process.spawn() / child_process.exec() options on Windows. This prevents console window creation without affecting functionality, as stdio is piped anyway.

Workaround

We've worked around this by:

  1. Creating a wrapper gh.exe that proxies calls to the real binary with CreateNoWindow = true
  2. Adding creationflags=subprocess.CREATE_NO_WINDOW (0x08000000) to Python subprocess calls in hooks

But these are band-aids — the fix should be in the extension's process spawning code.

Fix

In every child_process.spawn() / child_process.exec() / child_process.execFile() call, add:

const options = {
  // ... existing options
  windowsHide: true,  // Prevents console window flash on Windows
};

This is a no-op on non-Windows platforms.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗