Skip to content

Windows 11: Plugin subprocess spawns flash terminal windows #53730

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

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