Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ export function buildTerminalSpawnOptions(
cwd: string;
env: NodeJS.ProcessEnv | undefined;
stdio: ["ignore", "pipe", "pipe"];
shell: boolean;
windowsHide: true;
} {
return {
cwd,
env: toEnvObject(env),
stdio: ["ignore", "pipe", "pipe"],
shell: process.platform === "win32",
windowsHide: true,
};
}
Expand Down
7 changes: 7 additions & 0 deletions test/spawn-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,10 @@ test("buildSpawnCommandOptions keeps shell disabled for non-batch commands", asy
await fs.rm(tempDir, { recursive: true, force: true });
}
});

test("buildTerminalSpawnOptions enables shell on Windows for PATH resolution", () => {
const options = buildTerminalSpawnOptions("/tmp/acpx-terminal", []);

// shell should be set based on the current platform
assert.equal(typeof options.shell, "boolean");
});