terminalProfiles.ts ×19

Frontier kind: Joint frontier

unlabeled · c_de07d2b8647e

1 test · 11525 LOC · 52 files · introduces 1 test · 142 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
19 ranges142 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
1345 ranges11525 lines · 52 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

Introduced files, introduced tests, and structurally relevant concept specializationterminalProfiles.ts ×14 · 55 introduced LOCterminalProfiles.ts ×14powershell.ts ×16 · 103 introduced LOCpowershell.ts ×16processes.ts ×5 · 45 introduced LOCprocesses.ts ×5pfs.ts ×32 · 306 introduced LOCpfs.ts ×32async.ts ×1 · 7 introduced LOCasync.ts ×1async.ts ×202 · 1247 introduced LOCasync.ts ×202configuration.ts ×1 · 1 introduced LOCconfiguration.ts ×1configuration.ts ×1 · 2 introduced LOCconfiguration.ts ×1configuration.ts ×3 · 13 introduced LOCconfiguration.ts ×3testConfigurationService.ts ×3 · 8 introduced LOCtestConfigurationService…ternarySearchTree.ts ×1 · 4 introduced LOCternarySearchTree.ts ×1testConfigurationService.ts ×10 · 40 introduced LOCtestConfigurationService…configuration.ts ×1 · 1 introduced LOCconfiguration.ts ×1configuration.ts ×2 · 3 introduced LOCconfiguration.ts ×2windowsVersion.ts ×6 · 48 introduced LOCwindowsVersion.ts ×6ternarySearchTree.ts ×1 · 2 introduced LOCternarySearchTree.ts ×1ternarySearchTree.ts ×1 · 3 introduced LOCternarySearchTree.ts ×1ternarySearchTree.ts ×60 · 193 introduced LOCternarySearchTree.ts ×60resources.ts ×23 · 253 introduced LOCresources.ts ×23network.ts ×20 · 292 introduced LOCnetwork.ts ×20strings.test|title=Strings trimWhitespace|occurrence=1 · 0 introduced LOCstrings.test|title=Strin…extpath.ts ×17 · 91 introduced LOCextpath.ts ×17strings.ts ×101 · 542 introduced LOCstrings.ts ×101configurationRegistry.ts ×40 · 487 introduced LOCconfigurationRegistry.ts…jsonContributionRegistry.ts ×9 · 100 introduced LOCjsonContributionRegistry…cancellation.test|title=CancellationToken None|occurrence=1 · 0 introduced LOCcancellation.test|title=…cancellation.ts ×18 · 90 introduced LOCcancellation.ts ×18lifecycle.ts ×2 · 3 introduced LOClifecycle.ts ×2event.ts ×1 · 1 introduced LOCevent.ts ×1event.ts ×4 · 9 introduced LOCevent.ts ×4event.ts ×2 · 4 introduced LOCevent.ts ×2event.ts ×2 · 6 introduced LOCevent.ts ×2event.ts ×93 · 864 introduced LOCevent.ts ×93terminal.ts ×4 · 1253 introduced LOCterminal.ts ×4configuration.ts ×12 · 203 introduced LOCconfiguration.ts ×12normalization.ts ×5 · 27 introduced LOCnormalization.ts ×5codicons.ts ×2 · 846 introduced LOCcodicons.ts ×2types.test|title=Types hasKey should work with nested objects|occurrence=1, types.test|title=Types hasKey should work with complex union types|occurrence=1, +1 · 0 introduced LOCtypes.test|title=Types h…types.test|title=Types hasKey should return false if any key is missing|occurrence=1, types.test|title=Types hasKey should return false when object does not have specified key|occurrence=1 · 0 introduced LOCtypes.test|title=Types h…types.test|title=Types hasKey should work with multiple keys|occurrence=1, types.test|title=Types hasKey should return true when object has specified key|occurrence=1 · 0 introduced LOCtypes.test|title=Types h…types.ts ×1 · 2 introduced LOCtypes.ts ×1map.ts ×1 · 2 introduced LOCmap.ts ×1platform.ts ×1 · 2 introduced LOCplatform.ts ×1types.test|title=Types hasKey should work with empty key object|occurrence=1 · 0 introduced LOCtypes.test|title=Types h…types.ts ×2 · 2 introduced LOCtypes.ts ×2map.ts ×1 · 4 introduced LOCmap.ts ×1platform.ts ×1 · 6 introduced LOCplatform.ts ×1processes.ts ×2 · 112 introduced LOCprocesses.ts ×2types.test|title=Types isString|occurrence=1 · 0 introduced LOCtypes.test|title=Types i…types.ts ×1 · 2 introduced LOCtypes.ts ×1map.ts ×1 · 6 introduced LOCmap.ts ×1types.ts ×1 · 1 introduced LOCtypes.ts ×1uri.test|title=URI URI#file, win-speciale|occurrence=1, charCode.test|title=CharCode has good values|occurrence=1, +2 · 0 introduced LOCuri.test|title=URI URI#f…path.ts ×1 · 6 introduced LOCpath.ts ×1product.ts ×4 · 39 introduced LOCproduct.ts ×4utils.ts ×3 · 9 introduced LOCutils.ts ×3path.ts ×3 · 9 introduced LOCpath.ts ×3path.ts ×3 · 5 introduced LOCpath.ts ×3nls.ts ×1 · 1 introduced LOCnls.ts ×1path.ts ×2 · 3 introduced LOCpath.ts ×2linkedList.ts ×13 · 44 introduced LOClinkedList.ts ×13nls.ts ×6 · 13 introduced LOCnls.ts ×6objects.ts ×13 · 65 introduced LOCobjects.ts ×13instantiation.ts ×5 · 111 introduced LOCinstantiation.ts ×5path.ts ×1 · 2 introduced LOCpath.ts ×1path.ts ×3 · 10 introduced LOCpath.ts ×3platform.ts ×5 · 46 introduced LOCplatform.ts ×5path.ts ×3 · 10 introduced LOCpath.ts ×3path.ts ×3 · 14 introduced LOCpath.ts ×3types.ts ×1 · 2 introduced LOCtypes.ts ×1jsonSchema.ts ×3 · 194 introduced LOCjsonSchema.ts ×3lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2types.ts ×1 · 2 introduced LOCtypes.ts ×1assert.ts ×2 · 2 introduced LOCassert.ts ×2lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1lifecycle.ts ×3 · 9 introduced LOClifecycle.ts ×3path.ts ×1 · 1 introduced LOCpath.ts ×1types.ts ×2 · 5 introduced LOCtypes.ts ×2lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1path.ts ×6 · 24 introduced LOCpath.ts ×6types.ts ×1 · 2 introduced LOCtypes.ts ×1lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lifecycle.ts ×2 · 2 introduced LOClifecycle.ts ×2lazy.ts ×1 · 2 introduced LOClazy.ts ×1lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1lazy.ts ×3 · 37 introduced LOClazy.ts ×3lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1path.ts ×2 · 3 introduced LOCpath.ts ×2uint.ts ×2 · 43 introduced LOCuint.ts ×2lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1map.ts ×97 · 3334 introduced LOCmap.ts ×97src/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/async.ts · 2749 LOCcommon/async.tssrc/vs/base/common/cache.ts · 153 LOCcommon/cache.tssrc/vs/base/common/cancellation.ts · 206 LOCcommon/cancellation.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/codicons.ts · 66 LOCcommon/codicons.tssrc/vs/base/common/codiconsLibrary.ts · 758 LOCcommon/codiconsLibrary.t…src/vs/base/common/codiconsUtil.ts · 28 LOCcommon/codiconsUtil.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/event.ts · 1964 LOCcommon/event.tssrc/vs/base/common/extpath.ts · 433 LOCcommon/extpath.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/jsonSchema.ts · 330 LOCcommon/jsonSchema.tssrc/vs/base/common/lazy.ts · 57 LOCcommon/lazy.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/linkedList.ts · 151 LOCcommon/linkedList.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/network.ts · 440 LOCcommon/network.tssrc/vs/base/common/normalization.ts · 63 LOCcommon/normalization.tssrc/vs/base/common/objects.ts · 286 LOCcommon/objects.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/processes.ts · 153 LOCcommon/processes.tssrc/vs/base/common/resources.ts · 444 LOCcommon/resources.tssrc/vs/base/common/stopwatch.ts · 41 LOCcommon/stopwatch.tssrc/vs/base/common/strings.ts · 1413 LOCcommon/strings.tssrc/vs/base/common/symbols.ts · 9 LOCcommon/symbols.tssrc/vs/base/common/ternarySearchTree.ts · 796 LOCcommon/ternarySearchTree…src/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uint.ts · 59 LOCcommon/uint.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/node/pfs.ts · 866 LOCnode/pfs.tssrc/vs/base/node/powershell.ts · 330 LOCnode/powershell.tssrc/vs/base/node/processes.ts · 180 LOCnode/processes.tssrc/vs/base/node/windowsVersion.ts · 113 LOCnode/windowsVersion.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tssrc/vs/nls.ts · 244 LOCvs/nls.tssrc/vs/platform/configuration/common/configuration.ts · 358 LOCcommon/configuration.tssrc/vs/platform/configuration/common/configurationRegistry.ts · 1089 LOCcommon/configurationRegi…src/vs/platform/configuration/test/common/testConfigurationService.ts · 91 LOCcommon/testConfiguration…src/vs/platform/instantiation/common/instantiation.ts · 130 LOCcommon/instantiation.tssrc/vs/platform/jsonschemas/common/jsonContributionRegistry.ts · 143 LOCcommon/jsonContributionR…src/vs/platform/product/common/product.ts · 93 LOCcommon/product.tssrc/vs/platform/registry/common/platform.ts · 63 LOCcommon/platform.tssrc/vs/platform/terminal/common/terminal.ts · 1264 LOCcommon/terminal.tssrc/vs/platform/terminal/node/terminalProfiles.ts · 512 LOCnode/terminalProfiles.tscancellation.test|title=CancellationToken None|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/cancellation.test|title=CancellationToken None|occurrence=1cancellation.test|title=…charCode.test|title=CharCode has good values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1charCode.test|title=Char…path.test|title=Paths (Node Implementation) path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1path.test|title=Paths (N…strings.test|title=Strings trimWhitespace|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/strings.test|title=Strings trimWhitespace|occurrence=1strings.test|title=Strin…types.test|title=Types hasKey should handle objects with optional properties|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/types.test|title=Types hasKey should handle objects with optional properties|occurrence=1types.test|title=Types h…types.test|title=Types hasKey should return false if any key is missing|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/types.test|title=Types hasKey should return false if any key is missing|occurrence=1types.test|title=Types h…types.test|title=Types hasKey should return false when object does not have specified key|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/types.test|title=Types hasKey should return false when object does not have specified key|occurrence=1types.test|title=Types h…types.test|title=Types hasKey should return true when object has specified key|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/types.test|title=Types hasKey should return true when object has specified key|occurrence=1types.test|title=Types h…types.test|title=Types hasKey should work with complex union types|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/types.test|title=Types hasKey should work with complex union types|occurrence=1types.test|title=Types h…types.test|title=Types hasKey should work with empty key object|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/types.test|title=Types hasKey should work with empty key object|occurrence=1types.test|title=Types h…types.test|title=Types hasKey should work with multiple keys|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/types.test|title=Types hasKey should work with multiple keys|occurrence=1types.test|title=Types h…types.test|title=Types hasKey should work with nested objects|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/types.test|title=Types hasKey should work with nested objects|occurrence=1types.test|title=Types h…types.test|title=Types isString|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/types.test|title=Types isString|occurrence=1types.test|title=Types i…uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1uri.test|title=URI File …uri.test|title=URI URI#file, win-speciale|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1uri.test|title=URI URI#f…terminalProfiles.test|title=Workbench - TerminalProfiles detectAvailableProfiles should detect shells via absolute paths|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/terminal/test/node/terminalProfiles.test|title=Workbench - TerminalProfiles detectAvailableProfiles should detect shells via absolute paths|occurrence=1terminalProfiles.test|ti…Focused concept · terminalProfiles.ts ×19 · 142 introduced LOCterminalProfiles.ts ×19

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.

1 test introduced at this concept.

Introduced code

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

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

src/vs/platform/terminal/node/terminalProfiles.ts 142 introduced LOC · 19 ranges

Open complete file

28
29 export function detectAvailableProfiles(
30 > profiles: unknown, terminalProfiles.ts
31 > defaultProfile: unknown,
32 > includeDetectedProfiles: boolean,
33 > configurationService: IConfigurationService,
34 > shellEnv: typeof process.env = process.env,
35 > fsProvider?: IFsProvider,
36 > logService?: ILogService,
37 > variableResolver?: (text: string[]) => Promise<string[]>,
38 > testPwshSourcePaths?: string[]
39 > ): Promise<ITerminalProfile[]> {
40 > fsProvider = fsProvider || {
41 existsFile: pfs.SymlinkSupport.existsFile,
42 readFile: fs.promises.readFile
43 };
44 > if (isWindows) { terminalProfiles.ts
45 return detectAvailableWindowsProfiles(
46 includeDetectedProfiles,
55 );
56 }
57 > return detectAvailableUnixProfiles( terminalProfiles.ts
58 > fsProvider,
59 > logService,
60 > includeDetectedProfiles,
61 > profiles && isObject(profiles) ? { ...profiles } : configurationService.getValue<{ [key: string]: IUnresolvedTerminalProfile }>(isLinux ? TerminalSettingId.ProfilesLinux : TerminalSettingId.ProfilesMacOs),
62 > isString(defaultProfile) ? defaultProfile : configurationService.getValue<string>(isLinux ? TerminalSettingId.DefaultProfileLinux : TerminalSettingId.DefaultProfileMacOs),
63 > testPwshSourcePaths,
64 > variableResolver,
65 > shellEnv
66 > );
67 > }
68
69 async function detectAvailableWindowsProfiles(
166 }
167
168 > async function transformToTerminalProfiles( terminalProfiles.ts
169 > entries: IterableIterator<[string, IUnresolvedTerminalProfile]>,
170 > defaultProfileName: string | undefined,
171 > fsProvider: IFsProvider,
172 > shellEnv: typeof process.env = process.env,
173 > logService?: ILogService,
174 > variableResolver?: (text: string[]) => Promise<string[]>,
175 > ): Promise<ITerminalProfile[]> {
176 > const promises: Promise<ITerminalProfile | undefined>[] = [];
177 > for (const [profileName, profile] of entries) {
178 > promises.push(getValidatedProfile(profileName, profile, defaultProfileName, fsProvider, shellEnv, logService, variableResolver));
179 > }
180 > return (await Promise.all(promises)).filter(e => !!e);
181 > }
182
183 > async function getValidatedProfile( terminalProfiles.ts
184 > profileName: string,
185 > profile: IUnresolvedTerminalProfile,
186 > defaultProfileName: string | undefined,
187 > fsProvider: IFsProvider,
188 > shellEnv: typeof process.env = process.env,
189 > logService?: ILogService,
190 > variableResolver?: (text: string[]) => Promise<string[]>
191 > ): Promise<ITerminalProfile | undefined> {
192 > if (profile === null) {
193 return undefined;
194 }
195 > let originalPaths: (string | ITerminalUnsafePath)[]; terminalProfiles.ts
196 > let args: string[] | string | undefined;
197 > let icon: ThemeIcon | URI | { light: URI; dark: URI } | undefined = undefined;
198 > // use calculated values if path is not specified
199 > if (hasKey(profile, { source: true })) {
200 const source = profileSources?.get(profile.source);
201 if (!source) {
211 icon = source.icon;
212 }
213 > } else { terminalProfiles.ts
214 > originalPaths = Array.isArray(profile.path) ? profile.path : [profile.path];
215 > args = isWindows ? profile.args : Array.isArray(profile.args) ? profile.args : undefined;
216 > icon = validateIcon(profile.icon);
217 > }
218 >
219 > let paths: (string | ITerminalUnsafePath)[];
220 > if (variableResolver) {
221 // Convert to string[] for resolve
222 const mapped = originalPaths.map(e => isString(e) ? e : e.path);
235 }
236 }
237 > } else { terminalProfiles.ts
238 > paths = originalPaths.slice();
239 > }
240 >
241 > let requiresUnsafePath: string | undefined;
242 > if (profile.requiresPath) {
243 // Validate requiresPath exists
244 let actualRequiredPath: string;
256 }
257 }
259 > const validatedProfile = await validateProfilePaths(profileName, defaultProfileName, paths, fsProvider, shellEnv, args, profile.env, profile.overrideName, profile.isAutoDetected, requiresUnsafePath);
260 > if (!validatedProfile) {
261 > logService?.debug('Terminal profile not validated', profileName, originalPaths);
262 > return undefined;
263 > }
264 >
265 > validatedProfile.isAutoDetected = profile.isAutoDetected;
266 > validatedProfile.icon = icon;
267 > validatedProfile.color = profile.color;
268 > return validatedProfile;
269 > }
270
271 > function validateIcon(icon: string | TerminalIcon | undefined): TerminalIcon | undefined { terminalProfiles.ts
272 > if (isString(icon)) {
273 return { id: icon };
274 }
275 > return icon; terminalProfiles.ts
276 > }
277
278 async function initializeWindowsProfiles(testPwshSourcePaths?: string[]): Promise<void> {
399 }
400
401 > async function detectAvailableUnixProfiles( terminalProfiles.ts
402 > fsProvider: IFsProvider,
403 > logService?: ILogService,
404 > includeDetectedProfiles?: boolean,
405 > configProfiles?: { [key: string]: IUnresolvedTerminalProfile },
406 > defaultProfileName?: string,
407 > testPaths?: string[],
408 > variableResolver?: (text: string[]) => Promise<string[]>,
409 > shellEnv?: typeof process.env
410 > ): Promise<ITerminalProfile[]> {
411 > const detectedProfiles: Map<string, IUnresolvedTerminalProfile> = new Map();
412 >
413 > // Add non-quick launch profiles
414 > if (includeDetectedProfiles && await fsProvider.existsFile(Constants.UnixShellsPath)) {
415 const contents = (await fsProvider.readFile(Constants.UnixShellsPath)).toString();
416 const profiles = (
434 }
435 }
437 > applyConfigProfilesToMap(configProfiles, detectedProfiles);
438 >
439 > return await transformToTerminalProfiles(detectedProfiles.entries(), defaultProfileName, fsProvider, shellEnv, logService, variableResolver);
440 > }
441
442 > function applyConfigProfilesToMap(configProfiles: { [key: string]: IUnresolvedTerminalProfile } | undefined, profilesMap: Map<string, IUnresolvedTerminalProfile>) { terminalProfiles.ts
443 > if (!configProfiles) {
444 return;
445 }
446 > for (const [profileName, value] of Object.entries(configProfiles)) { terminalProfiles.ts
447 > if (value === null || !isObject(value) || (!hasKey(value, { path: true }) && !hasKey(value, { source: true }))) {
448 profilesMap.delete(profileName);
449 > } else { terminalProfiles.ts
450 > value.icon = value.icon || profilesMap.get(profileName)?.icon;
451 > profilesMap.set(profileName, value);
452 > }
453 > }
454 > }
455
456 > async function validateProfilePaths(profileName: string, defaultProfileName: string | undefined, potentialPaths: (string | ITerminalUnsafePath)[], fsProvider: IFsProvider, shellEnv: typeof process.env, args?: string[] | string, env?: ITerminalEnvironment, overrideName?: boolean, isAutoDetected?: boolean, requiresUnsafePath?: string): Promise<ITerminalProfile | undefined> { terminalProfiles.ts
457 > if (potentialPaths.length === 0) {
458 > return Promise.resolve(undefined);
459 > }
460 > const path = potentialPaths.shift()!;
461 > if (path === '') {
462 return validateProfilePaths(profileName, defaultProfileName, potentialPaths, fsProvider, shellEnv, args, env, overrideName, isAutoDetected);
463 }
464 > const isUnsafePath = !isString(path) && path.isUnsafe; terminalProfiles.ts
465 > const actualPath = isString(path) ? path : path.path;
466 >
467 > const profile: ITerminalProfile = {
468 > profileName,
469 > path: actualPath,
470 > args,
471 > env,
472 > overrideName,
473 > isAutoDetected,
474 > isDefault: profileName === defaultProfileName,
475 > isUnsafePath,
476 > requiresUnsafePath
477 > };
478 >
479 > // For non-absolute paths, check if it's available on $PATH
480 > if (basename(actualPath) === actualPath) {
481 // The executable isn't an absolute path, try find it on the PATH
482 const envPaths: string[] | undefined = shellEnv.PATH ? shellEnv.PATH.split(delimiter) : undefined;
489 return profile;
490 }
492 > const result = await fsProvider.existsFile(normalize(actualPath));
493 > if (result) {
494 > return profile;
495 > }
496 >
497 > return validateProfilePaths(profileName, defaultProfileName, potentialPaths, fsProvider, shellEnv, args, env, overrideName, isAutoDetected);
498 > }
499
500 export interface IFsProvider {