feat: support custom working directory for child process in start.js

This commit is contained in:
pomelo-nwu
2025-11-05 16:06:35 +08:00
parent 50d5cc2f6a
commit 448e30bf88

View File

@@ -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);