277
};
278
}
280
>
if (!this._execPath) {
281
throw new Error('Executable path not set to run sandbox commands');
282
}
284
throw new Error('Sandbox runtime path not resolved');
285
}
287
throw new Error('Ripgrep path not resolved');
288
}
290
>
// TMPDIR must be set as environment variable before the command
291
>
// Quote shell arguments so the wrapped command cannot break out of the outer shell.
292
>
const commandToRunInSandbox = this._getSandboxCommandWithPreservedCwd(command, cwd);
293
>
const sandboxRuntimeCommand = `PATH="$PATH:${this._pathDirname(this._rgPath)}" TMPDIR="${this._tempDir.path}" CLAUDE_TMPDIR="${this._tempDir.path}" "${this._execPath}" "${this._srtPath}" --settings "${this._sandboxConfigPath}" -c ${this._quoteShellArgument(commandToRunInSandbox)}`;
294
>
// On workbench Electron builds the exec path points at the Electron binary, so we
295
>
// prefix `ELECTRON_RUN_AS_NODE=1` to make it behave as Node.js. Remote workbench and
296
>
// the agent host already resolve a real `node` binary and the host clears the flag.
297
>
if (this._runAsNode) {
298
const nodeSandboxRuntimeCommand = `ELECTRON_RUN_AS_NODE=1 ${sandboxRuntimeCommand}`;
299
return {