win32: console window appears for every child process spawned by background service
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- backend
Línea de trabajo
Empieza rastreando la creación de procesos del servicio para las instantáneas de Git, la herramienta de shell y rg; el issue no indica los archivos pertinentes, así que busca el mensaje de registro spawning process y las llamadas correspondientes a spawn o execFile. Comprueba cómo esas llamadas manejan las opciones de Windows y luego verifica que los procesos secundarios del servicio se ejecuten sin ventanas de consola visibles. Se considera hecho cuando los procesos afectados ya no crean ventanas en Windows y siguen funcionando con normalidad.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 215k
- Forks
- 28.9k
- Merge medio
- 6 h 8 min
- PR fusionados (30 d)
- 411
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de anomalyco/opencode
-
pending close triaging
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
anomalyco/opencode#57939 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Opencde Github Actions Bot Cannot InstallPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoreproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
anomalyco/opencode#57911 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
anomalyco/opencode#57855 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
opencode api truncates large output when stdout is a pipe (un-awaited write before process.exit)Abiertopending close triaging
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/opencode#57816 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
opencode.tools adds the execute / session_move hint even when Code Mode is deniedPosiblemente ocupada @Yun-0000 la tomó hace 1 día. Abiertoreproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
anomalyco/opencode#57711 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de anomalyco/opencode
Issues similares
-
area:agent-view area:tui bug platform:macos
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
anthropics/claude-code#104558 ·
Los mantenedores suelen responder en 1 día
-
[CURRICULUM] computation fakdAbiertoupdater
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
UniversityOfHelsinkiCS/oodikone#5141 ·
-
maintanance
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
inmanta/web-console#7606 ·
Los mantenedores suelen responder en 1 día
-
bug skills
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
equinor/fusion-framework#5846 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100