Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

win32: console window appears for every child process spawned by background service

Closed Beginner friendly
#57,907 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, typescript
Domain
backend

Research direction

Start by tracing the service's process spawning for git snapshotting, the shell tool, and rg; the issue does not name the relevant files, so search for the spawning process log message and the corresponding spawn or execFile calls. Check how those calls handle Windows options, then verify that service child processes run without visible console windows. Done means the affected processes no longer create windows on Windows while continuing to work normally.

Written by the indexing model from the issue text.

Description

pending close triaging

Summary

On Windows, the background service spawns every child process (git, powershell, rg) with a new visible console window. Because the service runs console-less, Windows allocates a fresh console per spawn, so windows appear continuously during normal work.

Environment

  • opencode version: 2.1.2 (latest channel, npm global install)
  • OS: Windows 11 Home Single Language, build 26300 (win32 x64)
  • Terminal: Windows Terminal (WT_SESSION set), TERM=xterm-256color
  • Shell: C:\WINDOWS\system32\cmd.exe (ComSpec)
  • Install/channel: npm global (%APPDATA%\npm\opencode.cmd), not dev/beta
  • Active plugins: opencode-supervisor, opencode-auto-model, opencode-idle-compaction, github:steverova/kiro-provider, @xberg-io/opencode-liter-llm, @xberg-io/opencode-xberg, kibi-opencode

Reproduction

  1. On Windows 11, install and run opencode so the shared background service is active (opencode service status returns a URL).
  2. Open a workspace that is a git repository and start a session.
  3. Observe the desktop while the session runs, without invoking any tool manually.

Expected Behavior

Child processes spawned by the service run hidden. On Windows this means passing windowsHide: true (or CREATE_NO_WINDOW) to the spawn call, so no console window is allocated.

Actual Behavior

Each spawned process allocates its own console window, which appears on the desktop and steals focus. Windows are visible for git, powershell, and rg invocations. With continuous snapshot/diff activity this produces a near-constant stream of windows.

Evidence from %USERPROFILE%\.local\share\opencode\log\opencode.log — total spawning process records and breakdown by executable:

6887 total spawns
5190  git.EXE
1300  powershell.EXE
 222  rg.exe
 125  opencode.exe

Sample log line:

level=INFO msg="spawning process" command="C:\\Program Files\\Git\\cmd\\git.EXE" \
  args="[\"--git-dir\",\"...snapshot...\",\"--work-tree\",\"E:\\...\",\"ls-files\",...]" role=server

Additional Context

Why this happens: the service is started detached and owns no console. Per Windows process creation semantics, a child created without CREATE_NO_WINDOW/DETACHED_PROCESS from a console-less parent gets a new console allocated, which is shown to the user.

Workaround applied: no user-side config disables the spawns. Setting Windows Terminal as the default terminal application (HKCU:\Console\%%Startup → DelegationConsole/DelegationTerminal = {E12CFF52-A866-4C77-9A90-F570A7AA2C6B}) consolidates the windows into tabs of one window, which reduces visual noise but does not stop the consoles from being created.

Suggested fix: set windowsHide: true on the spawn/execFile calls used by the service for git snapshotting, the shell tool, and rg. Node's child_process defaults this to false, which is what produces the visible window here.

Frequency: consistent, every session; scales with git snapshot activity.

Dominant language
TypeScript
Stars
215k
Forks
28.9k
Avg merge
4h 21m
Merged PRs (30d)
476

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.