Fix seatbelt sandboxing when GEMINI_SANDBOX="" and starting with -s (#1298)

This commit is contained in:
N. Taylor Mullen 2025-06-22 19:33:29 +01:00 committed by GitHub
parent 3c656cfbc6
commit 6a1c62731b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -36,7 +36,12 @@ function getSandboxCommand(
}
// note environment variable takes precedence over argument (from command line or settings)
sandbox = process.env.GEMINI_SANDBOX?.toLowerCase().trim() ?? sandbox;
const environmentConfiguredSandbox =
process.env.GEMINI_SANDBOX?.toLowerCase().trim() ?? '';
sandbox =
environmentConfiguredSandbox?.length > 0
? environmentConfiguredSandbox
: sandbox;
if (sandbox === '1' || sandbox === 'true') sandbox = true;
else if (sandbox === '0' || sandbox === 'false' || !sandbox) sandbox = false;