Repository navigation
Description
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)
- 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.
- This matches the class of reports windows: console window flashes on every subprocess spawn (v2 next build) #42440, Windows: subprocess spawn (git, codegraph, etc.) flashes console window #31629, Desktop app: Console window flashes repeatedly even while idle (CREATE_NO_WINDOW missing) #22414, Local MCP servers flash terminal window on Windows #29532, Windows: Console window flash on subprocess spawn — root cause analysis and solutions (CREATE_NO_WINDOW, S4U, conhost --headless) #38715 (closed as plugin-related - which they are, but the failure mode is structural: plugins execute inside the same console-less process as core, so the Windows-specific requirement applies to all plugin code).
Requests
- 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.
- Add { windowsHide: true } - flashes stop.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal
Activity
opencode-agent commentedon Oct 7, 2026
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 withoutwindowsHidegets 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 passwindowsHide. A tester in that PR has confirmed it fixes a pluginexecSynccall that was missingwindowsHide, 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: truein plugins (as you did for opencode-rag) is the workaround.github-actions commentedon Oct 7, 2026
This issue might be a duplicate of existing issues. Please check:
neriousy commentedon Oct 7, 2026
you just gotta add a hideWindows param in the plugin
maintell commentedon Oct 7, 2026
Me too, that's annoying. The development environment is totally unavailable.
neriousy commentedon Oct 7, 2026
@maintell disable your plugins or adjust them to have windowsHide param when spawning processes
opencode-agent commentedon Oct 8, 2026
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
windowsHideopen 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 passingwindowsHide: truein 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.