terminalSandboxEngine.ts ×10

Frontier kind: Code frontier

unlabeled · c_444d4a299cd6

26 tests · 12589 LOC · 56 files · introduces 0 tests · 22 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges22 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1977 ranges12589 lines · 56 files · Browse complete extent
All tests (intent)
26 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: 22 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/sandbox/common/terminalSandboxEngine.ts 22 introduced LOC · 10 ranges

Open complete file

894
895 private _pathDirname(path: string): string {
896 > return (this._os === OperatingSystem.Windows ? win32 : posix).dirname(path); terminalSandboxEngine.ts
897 > }
898
899 private _getUriPath(uri: URI): string {
921
922 private _updateDenyReadPathsWithHome(configuredDenyRead: string[] | undefined): string[] {
923 > // TODO: On Windows, deny read on home directory. terminalSandboxEngine.ts
924 > if (this._os === OperatingSystem.Windows) {
925 return [...new Set(configuredDenyRead ?? [])];
926 }
927 > const userHome = this._userHome ? this._getUriPath(this._userHome) : undefined; terminalSandboxEngine.ts
928 > return [...new Set([...(configuredDenyRead ?? []), ...(userHome ? [userHome] : [])])];
929 > }
930
931 private async _updateAllowReadPathsWithAllowWrite(configuredAllowRead: string[] | undefined, allowWrite: string[], commandRuntimeAllowRead: string[] = []): Promise<string[]> {
932 > return [...new Set([...(configuredAllowRead ?? []), ...getTerminalSandboxReadAllowListForCommands(this._os, this._commandAllowListKeywords, this._commandAllowListCommandDetails), ...commandRuntimeAllowRead, ...this._getSandboxRuntimeReadPaths(), ...await this._getWorkspaceStorageReadPaths(), ...allowWrite])]; terminalSandboxEngine.ts
933 > }
934
935 private async _resolveFileSystemPaths(paths: string[] | undefined): Promise<string[]> {
1015
1016 private _getSandboxRuntimeReadPaths(): string[] {
1017 > if (!this._appRoot) { terminalSandboxEngine.ts
1018 return [];
1019 }
1020 > if (this._os === OperatingSystem.Windows) { terminalSandboxEngine.ts
1021 return this._windowsMxcRuntime.getRuntimeReadPaths(this._appRoot, this._mxcPath);
1022 }
1023 > const paths: string[] = [this._appRoot]; terminalSandboxEngine.ts
1024 > if (this._execPath) {
1025 > for (const path of [this._execPath, this._pathDirname(this._execPath)]) {
1026 > if (!this._isPathUnderAppRoot(path)) {
1027 paths.push(path);
1028 }
1030 > }
1031 > return paths;
1032 > }
1033
1034 private _isPathUnderAppRoot(path: string): boolean {
1035 > if (!this._appRoot) { terminalSandboxEngine.ts
1036 return false;
1037 }
1038 > return path === this._appRoot || path.startsWith(`${this._appRoot}${this._os === OperatingSystem.Windows ? win32.sep : posix.sep}`); terminalSandboxEngine.ts
1039 > }
1040
1041 private async _getWorkspaceStorageReadPaths(): Promise<string[]> {