From 91e9d43abd3a9a82f351213db4b4badddb32c289 Mon Sep 17 00:00:00 2001 From: Stefan Schoeffmann Date: Tue, 5 Aug 2025 21:34:19 +0200 Subject: [PATCH] Preserve spaces in quoted args This makes SDK mode work since the model gets the complete quoted prompt passed in (instead of just the first word) --- src/utils/codeCommand.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utils/codeCommand.ts b/src/utils/codeCommand.ts index b1b2afd..99ee796 100644 --- a/src/utils/codeCommand.ts +++ b/src/utils/codeCommand.ts @@ -31,7 +31,12 @@ export async function executeCodeCommand(args: string[] = []) { // Execute claude command const claudePath = process.env.CLAUDE_PATH || "claude"; - const claudeProcess = spawn(claudePath, args, { + + // Properly join arguments to preserve spaces in quotes + // Wrap each argument in double quotes to preserve single and double quotes inside arguments + const joinedArgs = args.length > 0 ? args.map(arg => `"${arg.replace(/\"/g, '\\"')}"`).join(" ") : ""; + + const claudeProcess = spawn(claudePath + (joinedArgs ? ` ${joinedArgs}` : ""), [], { env, stdio: "inherit", shell: true,