Skip to content

Windows 11: Plugin subprocess spawns flash terminal windows #53730

Closed as duplicate

Description

@MrDoe

Description

Summary

On Windows, every console-subsystem child process spawned without windowsHide: true gets a freshly allocated visible console. OpenCode v2 runs its server as a console-less background process (opencode serve --service), so this applies to every subprocess spawned by plugins and tools: on machines where Windows Terminal is the default terminal application, each spawn pops a WT window/tab (titled Terminal, then the child's exe path, e.g. C:\Program Files\Git\cmd\git.exe) that closes immediately - the recurring "terminal window flashes" reports.
OpenCode core already passes windowsHide on its own spawn paths (packages/util/src/cross-spawn-spawner.ts), but plugin authors have no guidance and cannot see the problem on macOS/Linux, so third-party plugins keep re-introducing it.

Environment

  • opencode 2.0.24 (@opencode/cli, opencode.exe) on Windows 11
  • Windows Terminal set as Default terminal application
  • TUI in Windows Terminal

Evidence (measured on Windows 11)

Requests

  1. Document it where plugin authors will see it (plugin SDK docs + the agent skill): "On Windows, pass windowsHide: true to every child_process call; plugins run inside a console-less service process, so an un-hidden spawn allocates a visible terminal window."
  2. Make it hard to hit: expose a small helper (e.g. spawnHidden(...) / a shell helper in @opencode-ai/plugin) that defaults windowsHide: true on win32 and wires stdio correctly, so plugins don't need to know the Windows internals.
  3. While you're there: a one-time audit of remaining spawn sites in core and adjacent tooling (LSP, MCP, updater, VS Code extension CLI management) against the same rule would be cheap insurance.

Plugins

opencode-rag, opencode-crosstalk

OpenCode version

2.0.24

Steps to reproduce

  1. Windows 11, Windows Terminal set as the default terminal application.
  2. Have a plugin (or tool) run e.g. execFileSync("git", ["rev-parse", "HEAD"], { stdio: "pipe" }) on a timer.
  3. Start opencode - a Windows Terminal window flashes on every tick.
  4. Add { windowsHide: true } - flashes stop.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Activity

  1. opencode-agent commented on Oct 7, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed write-up and the measurements, especially the side-by-side with and without windowsHide.

    This has the same root cause as #51887: the v2 service runs as a background process with no console (serve --service), so any plugin that starts a console program without windowsHide gets a visible window. The open PR #52594 fixes this in the service itself: on Windows the service gives itself a console with no window at startup, so child processes share it and no longer open windows. That covers plugin, hook and npm/git spawns even when they don't pass windowsHide. A tester in that PR has confirmed it fixes a plugin execSync call that was missing windowsHide, which is your case.

    Because of that, I'm marking this as a duplicate of #51887. The bot will close this issue in 1 day unless you reply explaining how your problem is different. If you think the plugin docs or helper are still worth having once #52594 lands, please say so here or on #51887. Until then, adding windowsHide: true in plugins (as you did for opencode-rag) is the workaround.

  2. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

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

    • #52281: Windows child-process console windows in the v2 service, including git and MCP spawns.
    • #52299: npm/git subprocess console windows during plugin installation and reload on Windows.
    • #31629: subprocess console flashes on Windows, including plugin-related commands.
  3. neriousy commented on Oct 7, 2026

    @neriousy
    Member

    you just gotta add a hideWindows param in the plugin

    import { execFileSync } from 'node:child_process';
    
    execFileSync('my-program.exe', ['arg1'], {
      windowsHide: true,
    });
    
  4. maintell commented on Oct 7, 2026

    @maintell

    Me too, that's annoying. The development environment is totally unavailable.

  5. neriousy commented on Oct 7, 2026

    @neriousy
    Member

    @maintell disable your plugins or adjust them to have windowsHide param when spawning processes

  6. opencode-agent commented on Oct 8, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #51887. There's been no reply in the past day explaining how this differs. The cause is the same: the v2 service runs without a console, so plugin spawns that don't pass windowsHide open visible windows. The open PR #52594 fixes this in the service itself so that child processes no longer get their own window. Until that lands, keep passing windowsHide: true in plugins, as you did for opencode-rag. Please follow #51887 for updates, and thanks again for the thorough measurements. If you still think the plugin docs or helper are worth having after #52594, you can bring it up on #51887 or open a separate feature request.

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

Metadata

Metadata

Assignees

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