Conversation
`execSync` with a string command runs through `cmd.exe` on Windows, and `windowsHide` defaults to false, so the child process is created with a console window whenever the caller has no console of its own — which is the case for the OpenCode service process. A newly created console window takes foreground focus, which breaks IME composition while a session is in use. The CLI entrypoint already passes `windowsHide: true`; these six call sites in `src/services/tags.ts` did not. `stdio: ["pipe", "pipe", "pipe"]` does not suppress the window on Windows — only `windowsHide` does. Fixes supermemoryai#101
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #101.
execSyncwith a string command runs throughcmd.exeon Windows, andwindowsHidedefaults tofalse, so the child process is created with a console window whenever the caller has no console of its own — which is the case for the OpenCode service process. A newly created console window takes foreground focus, which breaks IME composition while a session is in use.The CLI entrypoint already passes
windowsHide: true, which suggests the omission here is an oversight.stdio: ["pipe", "pipe", "pipe"]does not suppress the window on Windows — onlywindowsHidedoes.This adds
windowsHide: trueto the sixexecSyncoption objects insrc/services/tags.ts. No other change.Measured on Windows 11 (build 26200.8655), OpenCode 2.0.21, plugin 2.0.15
ConsoleWindowClasswindows in 133 s while a session was active;npxstartup of the MCP servers, not during turns.Attribution caveat, stated plainly: that capture could not isolate this plugin from other console-window sources (OpenCode's own MCP startup also spawns
cmd.exe /d /s /c "npx ...", whose children includenode.exeandgit-remote-https.exe). This PR therefore rests on the code defect, not on a clean A/B.Not addressed here
Two things noticed while investigating, left alone to keep this PR minimal:
getGitRoot()is not memoized (repoInfoCacheonly coversgetGitRepoInfo()), so it shells out togiton every call.execSyncwith a string command also routes throughcmd.exe;execFileSync("git", [...])with an argv array would avoid that extra process layer entirely.