From dd3677c17a0b780ca86d85e5ece982a81b734628 Mon Sep 17 00:00:00 2001 From: almihy92 Date: Mon, 1 Sep 2025 11:58:38 +0300 Subject: [PATCH] Fix argument quoting for Windows in claude command- to fix mcp config loading error --- src/extension.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index b27e2f5..284b08c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -532,7 +532,15 @@ class ClaudeChatProvider { } else { // Use native claude command console.log('Using native Claude command'); - claudeProcess = cp.spawn('claude', args, { + // On Windows with shell:true, we need to properly quote arguments with spaces + const quotedArgs = args.map(arg => { + // Quote arguments that contain spaces + if (arg.includes(' ') && !arg.startsWith('"')) { + return `"${arg}"`; + } + return arg; + }); + claudeProcess = cp.spawn('claude', quotedArgs, { shell: process.platform === 'win32', cwd: cwd, stdio: ['pipe', 'pipe', 'pipe'],