From 448e30bf88ed650e6fd68e0aa1820b111c1fd20b Mon Sep 17 00:00:00 2001 From: pomelo-nwu Date: Wed, 5 Nov 2025 16:06:35 +0800 Subject: [PATCH] feat: support custom working directory for child process in start.js --- scripts/start.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/start.js b/scripts/start.js index 9898d0be..baa9fd98 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -69,7 +69,14 @@ if (process.env.DEBUG) { // than the relaunched process making it harder to debug. env.GEMINI_CLI_NO_RELAUNCH = 'true'; } -const child = spawn('node', nodeArgs, { stdio: 'inherit', env }); +// Use process.cwd() to inherit the working directory from launch.json cwd setting +// This allows debugging from a specific directory (e.g., .todo) +const workingDir = process.env.QWEN_WORKING_DIR || process.cwd(); +const child = spawn('node', nodeArgs, { + stdio: 'inherit', + env, + cwd: workingDir, +}); child.on('close', (code) => { process.exit(code);