()
| 101 | }, |
| 102 | |
| 103 | async getEnvironmentOverrides(): Promise<Record<string, string>> { |
| 104 | const env: Record<string, string> = {} |
| 105 | // Apply session env vars set via /env (child processes only, not |
| 106 | // the REPL). Without this, `/env PATH=...` affects Bash tool |
| 107 | // commands but not PowerShell — so PyCharm users with a stripped |
| 108 | // PATH can't self-rescue. |
| 109 | // Ordering: session vars FIRST so the sandbox TMPDIR below can't be |
| 110 | // overridden by `/env TMPDIR=...`. bashProvider.ts has these in the |
| 111 | // opposite order (pre-existing), but sandbox isolation should win. |
| 112 | for (const [key, value] of getSessionEnvVars()) { |
| 113 | env[key] = value |
| 114 | } |
| 115 | if (currentSandboxTmpDir) { |
| 116 | // PowerShell on Linux/macOS honors TMPDIR for [System.IO.Path]::GetTempPath() |
| 117 | env.TMPDIR = currentSandboxTmpDir |
| 118 | env.CLAUDE_CODE_TMPDIR = currentSandboxTmpDir |
| 119 | } |
| 120 | return env |
| 121 | }, |
| 122 | } |
| 123 | } |
| 124 |
nothing calls this directly
no test coverage detected