Skip to content

Commit e38f0b6

Browse files
committed
fix: pass windowsHide to the git execSync calls
`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
1 parent 4271adf commit e38f0b6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/services/tags.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function getGitRoot(directory: string): string | null {
2323
cwd: directory,
2424
encoding: "utf-8",
2525
stdio: ["pipe", "pipe", "pipe"],
26+
windowsHide: true,
2627
}).trim();
2728
return gitRoot || null;
2829
}
@@ -31,13 +32,15 @@ function getGitRoot(directory: string): string | null {
3132
cwd: directory,
3233
encoding: "utf-8",
3334
stdio: ["pipe", "pipe", "pipe"],
35+
windowsHide: true,
3436
}).trim();
3537

3638
if (gitCommonDir === ".git") {
3739
const gitRoot = execSync("git rev-parse --show-toplevel", {
3840
cwd: directory,
3941
encoding: "utf-8",
4042
stdio: ["pipe", "pipe", "pipe"],
43+
windowsHide: true,
4144
}).trim();
4245
return gitRoot || null;
4346
}
@@ -51,6 +54,7 @@ function getGitRoot(directory: string): string | null {
5154
cwd: directory,
5255
encoding: "utf-8",
5356
stdio: ["pipe", "pipe", "pipe"],
57+
windowsHide: true,
5458
}).trim();
5559
return gitRoot || null;
5660
} catch {
@@ -68,6 +72,7 @@ function getGitEmail(directory: string): string | null {
6872
cwd: getProjectBasePath(directory),
6973
encoding: "utf-8",
7074
stdio: ["pipe", "pipe", "pipe"],
75+
windowsHide: true,
7176
}).trim();
7277
return email || null;
7378
} catch {
@@ -120,6 +125,7 @@ function getGitRepoInfo(directory: string): {
120125
cwd: directory,
121126
encoding: "utf-8",
122127
stdio: ["pipe", "pipe", "pipe"],
128+
windowsHide: true,
123129
}).trim();
124130
const normalizedRemote = normalizeGitRemote(remoteUrl);
125131
const displayRemote = remoteUrl.replace(/\/+$/, "").replace(/\.git$/i, "");

0 commit comments

Comments
 (0)