Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ 初心者向け
#57,907 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
backend

調査の方向性

まず、Git のスナップショット作成、shell ツール、rg に関するサービスのプロセス生成を追跡します。issue には該当するファイルが記載されていないため、ログメッセージ spawning process と、それに対応する spawn または execFile の呼び出しを検索します。これらの呼び出しが Windows のオプションをどのように扱うかを確認し、サービスの子プロセスが目に見えるコンソールウィンドウなしで実行されることを検証します。Windows で対象プロセスがウィンドウを作成しなくなり、引き続き正常に動作すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
215k
フォーク
28.9k
平均マージ
4時間 37分
マージ済み PR(30日)
512

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。