Skip to content

windows: console window flashes on every subprocess spawn (v2 next build) #42440

Closed

Description

@Egzza

Summary

On Windows, every time the agent runs a shell command (git, node, PowerShell, etc.), a console window briefly flashes open and then disappears. This happens for every command execution during a session.

Environment

  • opencode version: 0.0.0-next-17428
  • OS: Windows 11 Home 25H2, build 10.0.26200.8875 (win32 x64)
  • Terminal: TERM=xterm-256color, COLORTERM=truecolor (opencode TUI)
  • Shell: C:\WINDOWS\system32\cmd.exe
  • Install/channel: next (@opencode-ai/cli@0.0.0-next-17428)
  • Active plugins: herdr-agent-state.js, rtk.ts

Reproduction

  1. Run opencode2 on Windows.
  2. Ask the agent to perform any task that runs a shell command (e.g. git status, ls, or any command).
  3. Observe a console window flash on screen each time a command runs.

Expected Behavior

Subprocesses spawned for shell command execution run silently with no visible console window.

Actual Behavior

A black console window briefly appears and closes for every subprocess spawn. This is caused by subprocess spawning on Windows not setting the CREATE_NO_WINDOW creation flag (windowsHide: true in Node.js, HideWindow: true in Go's syscall.SysProcAttr).

Additional Context

Activity

  1. github-actions commented on Aug 13, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If these prior reports cover your case, consider adding any new v2-specific details there or confirming the issue is still unresolved in the v2 next build (which your report does — thank you for the explicit version callout).

  2. gabparrot commented on Aug 24, 2026

    @gabparrot

    For Windows users, workaround for the tab focus-stealing: Windows Terminal → Settings → Startup → Default terminal application → Windows Console Host. The spawn then flashes as a detached window instead of hijacking your active terminal

  3. gabparrot commented on Aug 25, 2026

    @gabparrot

    @Egzza Is your main terminal Powershell 7? (pwsh.exe)

  4. gabparrot commented on Aug 26, 2026

    @gabparrot
  5. neriousy commented on Aug 26, 2026

    @neriousy
    Member

    I can't reproduce that, can u do a video showcasing this?

  6. neriousy commented on Aug 26, 2026

    @neriousy
    Member

    Or which models are you using etc

  7. gabparrot commented on Aug 26, 2026

    @gabparrot

    No plugins. I replicated in other variables, but here my current setup for replication:

    • On windows 11
    • Open terminal, go to settings
    • Set Powershell 7 as the default profile (not microsoft powershell 5.x)
    • Set Microsoft Console Host as the default new terminal application
    • pwsh.exe (powershell 7+)
    • opencode2
    • Ask any claude or gpt model to grep "hello world" in the sub folders
    • Minimize to desktop to be sure it doesnt spawn under your window
  8. gabparrot commented on Aug 26, 2026

    @gabparrot

    I will screen record it later today if you still cant replicate it. Seen this issue in multiple discussions. No time right now

  9. PVLPM commented on Oct 1, 2026

    @PVLPM

    @neriousy I am chasing you across issues. I have been able to record these blinks. Sometimes they blink; sometimes they spawn and stay for 5-10 seconds. It's random, but I am pretty sure that there is some kind of logic behind it.

    https://github.com/user-attachments/assets/1ba88a02-58fb-4bb0-9f51-d05b50b924c0
    https://github.com/user-attachments/assets/a988d5ea-da93-4ba9-ad12-e7a601b012ce
    https://github.com/user-attachments/assets/5921d069-7fac-431f-aec9-b4b6c13cae1e

  10. neriousy commented on Oct 1, 2026

    @neriousy
    Member

    Heey - do you have any old plugins? Like did you use omo? @PVLPM

  11. neriousy commented on Oct 1, 2026

    @neriousy
    Member

    Try to clean up your .opencode/plugins folder

  12. PVLPM commented on Oct 1, 2026

    @PVLPM

    @neriousy
    My ".config\opencode\plugins" is empty except that I had bun-preload.ts, which was a workaround when OpenCode moved from Tauri to Electron, and I couldn't use the desktop because of the "bun is not defined" issue (I also reported that at that time). Here is a brief description of bun-preload.ts file:

     * Bun API polyfill for OpenCode Desktop (Electron/Node.js).
     *
     * OpenCode Desktop runs its server inside Electron's bundled Node.js,
     * NOT Bun. Plugins that reference Bun.* globals (Bun.env, Bun.write,
     * Bun.file, $, etc.) crash with "Bun is not defined".
     *
     * This preload plugin defines those globals with Node.js equivalents
     * before any other plugin code runs. Place it FIRST in the plugin array.
    

    I removed it, restarted OpenCode, and got bombarded by those blinks, like 20-30 in 2-3 seconds, lol.
    Plugins list:

      "plugin": [
        "oh-my-opencode-slim",
        "C:\\Users\\User\\.hindsight\\coding-agents",
        "superpowers@git+https://github.com/obra/superpowers.git"
      ],
    

    All plugins updated to comply with v2.

    I am still using the v1 config. Is that a thing?

    UPD: And yes, the videos were recorded on 2.0.21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions