From 6a4fb067cdbabde5d562c0f8a93882b258688a72 Mon Sep 17 00:00:00 2001 From: claude-bot Date: Sat, 2 May 2026 20:52:52 +0900 Subject: [PATCH] Handle pyenv Windows shims --- src/python-runtime.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/python-runtime.ts b/src/python-runtime.ts index 0659e1a..541b8c7 100644 --- a/src/python-runtime.ts +++ b/src/python-runtime.ts @@ -12,6 +12,15 @@ export interface PythonCommandSpec { viaCmdShell?: boolean; } +function shouldUseCmdShell(command: string): boolean { + if (process.platform !== "win32") { + return false; + } + + const lower = command.toLowerCase(); + return !path.isAbsolute(command) || lower.endsWith(".bat") || lower.endsWith(".cmd"); +} + function splitCommand(command: string): string[] { const parts = command.match(/(?:[^\s"]+|"[^"]*")+/g) ?? []; return parts.map((part) => part.replace(/^"(.*)"$/, "$1")); @@ -138,7 +147,7 @@ export async function resolveBasePythonCommand(config: AppConfig): Promise { +export async function resolveWorkerPythonCommand(config: AppConfig): Promise { const venvPath = resolveVenvPythonPath(config); if (await fileExists(venvPath)) { return { command: venvPath, args: [] };