You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows 11: Plugin subprocess spawns flash terminal windows #53730
On Windows, every console-subsystem child process spawned withoutwindowsHide: 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)
Console-less parent + child without windowsHide - one visible console per spawn; with windowsHide: true - no window, ever. Node 24 and Bun 1.4.2 (the runtime embedded in opencode.exe 2.0.24) both honor the option for spawn / execFileSync / execSync.
Method: spawn a detached: true, stdio: "ignore" intermediate (console-less, like the serve process) which then runs cmd.exe with/without the option, while a PowerShell EnumWindows monitor logs visible windows of class ConsoleWindowClass / CASCADIA_HOSTING_WINDOW_CLASS with their process chains. Note for anyone reproducing: a console-based parent invalidates the test (children inherit the hidden console and never allocate a window), and conhost.exe presence alone proves nothing - hidden consoles allocate conhost too.
Real-world repro: a plugin (OpenCodeRAG) spawning git rev-parse / git diff from its file watcher produced dozens of visible git.exe windows per index pass; adding windowsHide: true to its 8 spawn sites eliminated all flashes. Bonus finding: spawn latency dropped from ~0.7 s to ~65 ms per call - visible-console creation pays the Windows Terminal handoff.
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."
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.
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
Windows 11, Windows Terminal set as the default terminal application.
Have a plugin (or tool) run e.g. execFileSync("git", ["rev-parse", "HEAD"], { stdio: "pipe" }) on a timer.
Start opencode - a Windows Terminal window flashes on every tick.
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
Evidence (measured on Windows 11)
Requests
Plugins
opencode-rag, opencode-crosstalk
OpenCode version
2.0.24
Steps to reproduce
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal