fix(coding-agent): avoid cmd.exe for git installs on windows closes #3642

This commit is contained in:
Mario Zechner
2026-04-24 13:55:05 +02:00
parent c06750410a
commit 7bd9f6500d
4 changed files with 105 additions and 3 deletions

View File

@@ -460,6 +460,20 @@ Content`,
});
});
describe("windows command spawning", () => {
it("should avoid the shell for git so Windows paths with spaces stay single arguments", () => {
vi.spyOn(process, "platform", "get").mockReturnValue("win32");
const managerWithInternals = packageManager as unknown as {
shouldUseWindowsShell(command: string): boolean;
};
expect(managerWithInternals.shouldUseWindowsShell("git")).toBe(false);
expect(managerWithInternals.shouldUseWindowsShell("npm")).toBe(true);
expect(managerWithInternals.shouldUseWindowsShell("pnpm")).toBe(true);
expect(managerWithInternals.shouldUseWindowsShell("C:/Program Files/nodejs/npm.cmd")).toBe(true);
});
});
describe("npmCommand", () => {
it("should use npmCommand argv for npm installs", async () => {
settingsManager = SettingsManager.inMemory({