Repository navigation
Windows: git probes via execSync flash a console window (missing windowsHide) #105
Description
Summary
On Windows, the plugin's git-discovery helpers in src/services/tags.ts call execSync("git ...") without windowsHide: true. Because the plugin runs inside OpenCode's console-less background service process (opencode-cli serve --service), each call allocates a new visible console window (cmd.exe) that flashes and steals focus from the app.
Environment
- opencode-supermemory: 2.0.15 (current
lateston npm) - OpenCode: Desktop 2.0.24 (bundled
opencode-cli2.0.24) - OS: Windows 10 Pro, build 19045 (win32 x64)
- Shell / default terminal:
cmd.exe/ Windows Console Host
Reproduction
- Windows + OpenCode Desktop with this plugin enabled, in a git working copy.
- Use sessions normally (the flashes also happen when project "location services" boot).
- Observe bursts of
cmd.exewindows flashing and stealing focus.
Evidence
Process monitor (parent chain + command lines) captured during a single ~17 s burst:
- 53 ×
cmd.exewith parentopencode-cli.exe serve --service - 46 of them were
cmd.exe /d /s /c "git ..." - 56 ×
git.exechildren
Command lines captured (they match the helpers in src/services/tags.ts exactly):
cmd.exe /d /s /c "git rev-parse --git-common-dir"
cmd.exe /d /s /c "git rev-parse --show-toplevel"
cmd.exe /d /s /c "git config user.email"
cmd.exe /d /s /c "git remote get-url origin"
Root cause
On Windows, a child process spawned by a console-less parent gets a new visible console unless it is created with CREATE_NO_WINDOW. Node maps windowsHide: true to CREATE_NO_WINDOW. execSync runs through a shell, so on Windows it spawns cmd.exe /d /s /c, and without windowsHide that cmd.exe gets a visible console window.
Relevant call sites (dist/index.js, source src/services/tags.ts):
execSync("git rev-parse --git-common-dir", { cwd: directory, encoding: "utf-8", stdio: ["pipe","pipe","pipe"] });
execSync("git rev-parse --show-toplevel", { cwd: directory, encoding: "utf-8", stdio: ["pipe","pipe","pipe"] });
execSync("git config user.email", { cwd: base, encoding: "utf-8", stdio: ["pipe","pipe","pipe"] });
execSync("git remote get-url origin", { cwd: directory, encoding: "utf-8", stdio: ["pipe","pipe","pipe"] });Note: dist/cli.js already passes { windowsHide: true } in one execFile call, so the option is known in the codebase but missing on these git helpers.
Suggested fix
Add windowsHide: true to every execSync / child_process call that spawns a process (the git helpers above, plus any other spawn sites). Optionally, avoid execSync for git since it is a native .exe and needs no shell. This removes the flashing on Windows without affecting macOS/Linux.
Related
- Windows: every child
cmd.exe(git probes, MCP spawns) flashes a visible console window and steals focus despitewindowsHidebeing set anomalyco/opencode#52281 —cmd.exespawns flash a visible console on Windows - Windows 11: Plugin subprocess spawns flash terminal windows anomalyco/opencode#53730 — the failure mode is structural: plugin code runs inside OpenCode's console-less service process, so every un-hidden spawn shows a window
Activity
capy-ai commentedon Oct 17, 2026
Fixed in 2.0.17 by #102. Every git probe now passes windowsHide: true, so no console window flashes on Windows. Thanks for the report.