1
>
/*---------------------------------------------------------------------------------------------
terminalProfiles.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import * as fs from 'fs';
7
>
import * as cp from 'child_process';
8
>
import { Codicon } from '../../../base/common/codicons.js';
9
>
import { basename, delimiter, normalize, dirname, resolve } from '../../../base/common/path.js';
10
>
import { isLinux, isWindows } from '../../../base/common/platform.js';
11
>
import { findExecutable } from '../../../base/node/processes.js';
12
>
import { hasKey, isObject, isString } from '../../../base/common/types.js';
13
>
import { URI } from '../../../base/common/uri.js';
14
>
import * as pfs from '../../../base/node/pfs.js';
15
>
import { enumeratePowerShellInstallations } from '../../../base/node/powershell.js';
16
>
import { IConfigurationService } from '../../configuration/common/configuration.js';
17
>
import { ILogService } from '../../log/common/log.js';
18
>
import { ITerminalEnvironment, ITerminalExecutable, ITerminalProfile, ITerminalProfileSource, ITerminalUnsafePath, ProfileSource, TerminalIcon, TerminalSettingId } from '../common/terminal.js';
19
>
import { ThemeIcon } from '../../../base/common/themables.js';
20
>
import { getWindowsBuildNumberAsync } from '../../../base/node/windowsVersion.js';
21
>
22
>
const enum Constants {
23
>
UnixShellsPath = '/etc/shells'
24
>
}
25
>
26
>
let profileSources: Map<string, IPotentialTerminalProfile> | undefined;
27
>
let logIfWslNotInstalled: boolean = true;
28
>
29
>
export function detectAvailableProfiles(
30
profiles: unknown,
31
defaultProfile: unknown,