terminalSandboxEngine.ts ×13

Frontier kind: Code frontier

unlabeled · c_bcda0050cda7

32 tests · 12551 LOC · 56 files · introduces 0 tests · 33 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges33 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1968 ranges12551 lines · 56 files · Browse complete extent
All tests (intent)
32 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: 33 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/sandbox/common/terminalSandboxEngine.ts 33 introduced LOC · 13 ranges

Open complete file

383 return undefined;
384 }
385 > await this._resolveRuntimeInfo(); terminalSandboxEngine.ts
386 if (!this._sandboxConfigPath || forceRefresh || this._needsForceUpdateConfigFile) {
387 > this._sandboxConfigPath = await this._createSandboxConfig(); terminalSandboxEngine.ts
388 > this._needsForceUpdateConfigFile = false;
389 > }
390 > return this._sandboxConfigPath;
391 }
392
621
622 private async _createSandboxConfig(): Promise<string | undefined> {
623 > if ((await this.isEnabled()) && !this._tempDir) { terminalSandboxEngine.ts
624 > await this._initTempDir();
625 > }
626 > if (!this._tempDir) {
627 return undefined;
628 }
630 > const allowNetwork = this._commandAllowNetwork || await this.isSandboxAllowNetworkEnabled();
631 const linuxFileSystemSetting = this._os === OperatingSystem.Linux
632 ? this._getSettingValue<ITerminalSandboxFileSystemSetting>(AgentSandboxSettingId.AgentSandboxLinuxFileSystem) ?? {}
633 : {};
634 > const macFileSystemSetting = this._os === OperatingSystem.Macintosh terminalSandboxEngine.ts
635 ? this._getSettingValue<ITerminalSandboxFileSystemSetting>(AgentSandboxSettingId.AgentSandboxMacFileSystem) ?? {}
636 : {};
637 > const windowsFileSystemSetting = this._os === OperatingSystem.Windows terminalSandboxEngine.ts
638 ? this._getSettingValue<ITerminalSandboxFileSystemSetting>(AgentSandboxSettingId.AgentSandboxWindowsFileSystem) ?? {}
639 : {};
640 > const windowsSchemaVersion = this._os === OperatingSystem.Windows terminalSandboxEngine.ts
641 ? this._getSettingValue<string>(AgentSandboxSettingId.AgentSandboxWindowsSchemaVersion)
642 : undefined;
643 > const runtimeSetting = this._getSettingValue<Record<string, unknown>>(AgentSandboxSettingId.AgentSandboxAdvancedRuntime) ?? {}; terminalSandboxEngine.ts
644 > const commandRuntimeSetting = getTerminalSandboxRuntimeConfigurationForCommands(this._os, this._commandAllowListCommandDetails);
645 > const commandRuntimeAllowReadPaths = this._getCommandRuntimeFileSystemPaths(commandRuntimeSetting, 'allowRead');
646 > const commandRuntimeAllowWritePaths = this._getCommandRuntimeFileSystemPaths(commandRuntimeSetting, 'allowWrite');
647 > const configFileUri = URI.joinPath(this._tempDir, `vscode-sandbox-settings-${this._sandboxSettingsId}.json`);
648 > const configFilePath = this._getUriPath(configFileUri);
649 > let allowWritePaths: string[] = [];
650 > let allowReadPaths: string[] = [];
651 > let denyReadPaths: string[] = [];
652 > let denyWritePaths: string[] | undefined;
653 > if (this._os === OperatingSystem.Windows) {
654 const filesystemPolicy = await this._getWindowsMxcFilesystemPolicy();
655 const env = await this._getWindowsMxcEnvironment();
661 denyReadPaths = await this._resolveFileSystemPaths(windowsFileSystemSetting.denyRead ?? []);
662 this._windowsMxcEnvironment = env;
663 > } else if (this._os === OperatingSystem.Macintosh) { terminalSandboxEngine.ts
664 allowWritePaths = (await this._resolveFileSystemPaths(await this._updateAllowWritePathsWithWorkspaceFolders(macFileSystemSetting.allowWrite, commandRuntimeAllowWritePaths))).filter(path => path !== configFilePath);
665 allowReadPaths = await this._resolveFileSystemPaths(await this._updateAllowReadPathsWithAllowWrite(macFileSystemSetting.allowRead, allowWritePaths, commandRuntimeAllowReadPaths));
672 denyWritePaths = await this._resolveFileSystemPaths(linuxFileSystemSetting.denyWrite);
673 }
674 > const sandboxSettings = this._os === OperatingSystem.Windows ? await this._windowsMxcRuntime.createConfig({ terminalSandboxEngine.ts
675 command: this._commandLine ?? '',
676 shell: this._commandShell,
683 denyReadPaths,
684 env: this._windowsMxcEnvironment ?? [],
685 > }, this._buildSandboxPayload) : { terminalSandboxEngine.ts
686 network: allowNetwork ? { allowedDomains: [], deniedDomains: [], enabled: false } : this.getResolvedNetworkDomains(),
687 filesystem: {
692 },
693 };
694 > if (this._os !== OperatingSystem.Windows) { terminalSandboxEngine.ts
695 const sandboxRuntimeSettings = sandboxSettings as Record<string, unknown>;
696 this._mergeAdditionalSandboxConfigProperties(sandboxRuntimeSettings, runtimeSetting);
700 }
701 }
702 > this._sandboxConfigPath = configFilePath; terminalSandboxEngine.ts
703 > await this._fileService.createFile(configFileUri, VSBuffer.fromString(JSON.stringify(sandboxSettings, null, '\t')), { overwrite: true });
704 > return this._sandboxConfigPath;
705 > }
706
707 private async _getFileSystemAccessPaths(configFilePath: string | undefined): Promise<ITerminalSandboxFileSystemAccessPaths> {