From 5ec4ea9b4d425269c9e9052503ad85b5caaa976e Mon Sep 17 00:00:00 2001 From: christine betts Date: Fri, 8 Aug 2025 15:35:47 +0000 Subject: [ide-mode] Wire up env variables to sandbox (#5804) --- packages/cli/src/utils/sandbox.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'packages/cli/src') diff --git a/packages/cli/src/utils/sandbox.ts b/packages/cli/src/utils/sandbox.ts index 3550f45b..dfd2065f 100644 --- a/packages/cli/src/utils/sandbox.ts +++ b/packages/cli/src/utils/sandbox.ts @@ -614,6 +614,17 @@ export async function start_sandbox( args.push('--env', `COLORTERM=${process.env.COLORTERM}`); } + // Pass through IDE mode environment variables + for (const envVar of [ + 'GEMINI_CLI_IDE_SERVER_PORT', + 'GEMINI_CLI_IDE_WORKSPACE_PATH', + 'TERM_PROGRAM', + ]) { + if (process.env[envVar]) { + args.push('--env', `${envVar}=${process.env[envVar]}`); + } + } + // copy VIRTUAL_ENV if under working directory // also mount-replace VIRTUAL_ENV directory with /sandbox.venv // sandbox can then set up this new VIRTUAL_ENV directory using sandbox.bashrc (see below) -- cgit v1.2.3