terminalSandboxEngine.ts ×8

Frontier kind: Code frontier

unlabeled · c_a0c199b49379

11 tests · 12750 LOC · 56 files · introduces 0 tests · 18 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges18 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2040 ranges12750 lines · 56 files · Browse complete extent
All tests (intent)
11 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 18 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/sandbox/common/terminalSandboxEngine.ts 18 introduced LOC · 8 ranges

Open complete file

277 };
278 }
280 > if (!this._execPath) {
281 throw new Error('Executable path not set to run sandbox commands');
282 }
283 > if (!this._srtPath) { terminalSandboxEngine.ts
284 throw new Error('Sandbox runtime path not resolved');
285 }
286 > if (!this._rgPath) { terminalSandboxEngine.ts
287 throw new Error('Ripgrep path not resolved');
288 }
289 > // Use ELECTRON_RUN_AS_NODE=1 to make Electron executable behave as Node.js terminalSandboxEngine.ts
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 {
464
465 private _getSandboxCommandWithPreservedCwd(command: string, cwd: URI | undefined): string {
466 > if (this._os !== OperatingSystem.Linux || !cwd?.path || cwd.path === this._tempDir?.path) { terminalSandboxEngine.ts
467 return command;
468 }
469 return `cd ${this._quoteShellArgument(cwd.path)} && ${command}`;
471
472 private _wrapSandboxRuntimeCommandForLaunch(sandboxRuntimeCommand: string, cwd: URI | undefined): string {
473 > const tempDirPath = this._tempDir?.path; terminalSandboxEngine.ts
474 > return this._os === OperatingSystem.Linux && cwd?.path && tempDirPath && cwd.path !== tempDirPath
475 ? `cd ${this._quoteShellArgument(tempDirPath)}; ${sandboxRuntimeCommand}`
476 : sandboxRuntimeCommand;
478
479 private _wrapUnsandboxedCommand(command: string, shell?: string): string {