win32: console window appears for every child process spawned by background service
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
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 (
latestchannel, npm global install) - OS: Windows 11 Home Single Language, build 26300 (win32 x64)
- Terminal: Windows Terminal (
WT_SESSIONset),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
- On Windows 11, install and run opencode so the shared background service is active (
opencode service statusreturns a URL). - Open a workspace that is a git repository and start a session.
- 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anomalyco/opencode
-
desktop: maximized state lost when saved bounds exceed the displayPossibly taken A pull request linked to this issue is open or already merged. Openreproduced
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
anomalyco/opencode#58247 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anomalyco/opencode#58216 · 1 comment ·
Maintainers usually reply within 1 day
-
pending close triaging
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anomalyco/opencode#58181 · 1 comment ·
Maintainers usually reply within 1 day
-
Opencde Github Actions Bot Cannot InstallPossibly taken @zzz-creator claimed this 1 day ago. Openreproduced
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anomalyco/opencode#57911 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
anomalyco/opencode#57855 · 1 comment ·
Maintainers usually reply within 1 day
All issues in anomalyco/opencode
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
lyswhut/lx-music-desktop#3026 ·
-
area: ci type: test
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
schlessera/brain-kit#2769 ·
Maintainers usually reply within 1 day
-
Read a vector index's quantization back on Neo4j 2026.10, which reports vector.quantization.typeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
liberation-data/drivine#231 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
alveusgg/alveusgg#2502 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day