diff --git a/src/vs/workbench/api/browser/mainThreadTerminalService.ts b/src/vs/workbench/api/browser/mainThreadTerminalService.ts index 93c639e58a644a832a6e1d1eb3f6b6d794a6214d..ab8ed7cb12c5bcec402168dfab55924dd2f2b310 100644 --- a/src/vs/workbench/api/browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/browser/mainThreadTerminalService.ts @@ -355,7 +355,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape private async _onRequestAvailableProfiles(req: IAvailableProfilesRequest): Promise { if (this._isPrimaryExtHost() && this._extHostKind !== ExtensionHostKind.LocalWebWorker) { - req.callback(await this._proxy.$getAvailableProfiles(req.quickLaunchOnly)); + req.callback(await this._proxy.$getAvailableProfiles(req.configuredProfilesOnly)); } } diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 06c7e22777a01996c55a7cca3fb641f5d1a99bc1..eb4e3efadabd28bf97f7f8ba6879eb049560ceb8 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -1657,8 +1657,7 @@ export interface ExtHostTerminalServiceShape { $acceptProcessRequestCwd(id: number): void; $acceptProcessRequestLatency(id: number): number; $acceptWorkspacePermissionsChanged(isAllowed: boolean): void; - // TODO: Change quickLaunchOnly to "includeAutoDetected" or something similar - $getAvailableProfiles(quickLaunchOnly: boolean): Promise; + $getAvailableProfiles(configuredProfilesOnly: boolean): Promise; $getDefaultShellAndArgs(useAutomationShell: boolean): Promise; $provideLinks(id: number, line: string): Promise; $activateLink(id: number, linkId: number): void; diff --git a/src/vs/workbench/api/common/extHostTerminalService.ts b/src/vs/workbench/api/common/extHostTerminalService.ts index 8c34992d1061bfd92acd771a9ab2b327d018a78e..5a74e4663b5b0e6c6a7a1d02cede6994368da359 100644 --- a/src/vs/workbench/api/common/extHostTerminalService.ts +++ b/src/vs/workbench/api/common/extHostTerminalService.ts @@ -328,7 +328,7 @@ export abstract class BaseExtHostTerminalService extends Disposable implements I public abstract createTerminalFromOptions(options: vscode.TerminalOptions): vscode.Terminal; public abstract getDefaultShell(useAutomationShell: boolean, configProvider: ExtHostConfigProvider): string; public abstract getDefaultShellArgs(useAutomationShell: boolean, configProvider: ExtHostConfigProvider): string[] | string; - public abstract $getAvailableProfiles(quickLaunchOnly: boolean): Promise; + public abstract $getAvailableProfiles(configuredProfilesOnly: boolean): Promise; public abstract $getDefaultShellAndArgs(useAutomationShell: boolean): Promise; public abstract $acceptWorkspacePermissionsChanged(isAllowed: boolean): void; @@ -779,7 +779,7 @@ export class WorkerExtHostTerminalService extends BaseExtHostTerminalService { throw new NotSupportedError(); } - public $getAvailableProfiles(quickLaunchOnly: boolean): Promise { + public $getAvailableProfiles(configuredProfilesOnly: boolean): Promise { throw new NotSupportedError(); } diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 6bade2ed5d68ad90e2f84faf5ade5ac1dc6d4de2..92d2cbd06466cdde325c0f44bad042adee5539d9 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -136,9 +136,9 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService { return this._variableResolver; } - public async $getAvailableProfiles(quickLaunchOnly: boolean): Promise { + public async $getAvailableProfiles(configuredProfilesOnly: boolean): Promise { const config = await (await this._extHostConfiguration.getConfigProvider()).getConfiguration().get('terminal.integrated'); - return detectAvailableProfiles(quickLaunchOnly, this._logService, config as ITerminalConfiguration, await this._variableResolverPromise, this._lastActiveWorkspace); + return detectAvailableProfiles(configuredProfilesOnly, this._logService, config as ITerminalConfiguration, await this._variableResolverPromise, this._lastActiveWorkspace); } public async $getDefaultShellAndArgs(useAutomationShell: boolean): Promise { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalService.ts b/src/vs/workbench/contrib/terminal/browser/terminalService.ts index b6b59cec9fbf9956e16795fb9b8218b220167e54..842ca3cc3371731cdc7a3bc2d388d196aa37cefa 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalService.ts @@ -361,14 +361,14 @@ export class TerminalService implements ITerminalService { return this._updateAvailableProfilesNow(); } - private async _detectProfiles(quickLaunchOnly: boolean): Promise { + private async _detectProfiles(configuredProfilesOnly: boolean): Promise { await this._extensionService.whenInstalledExtensionsRegistered(); // Wait for the remoteAuthority to be ready (and listening for events) before firing // the event to spawn the ext host process const conn = this._remoteAgentService.getConnection(); const remoteAuthority = conn ? conn.remoteAuthority : 'null'; await this._whenExtHostReady(remoteAuthority); - return new Promise(r => this._onRequestAvailableProfiles.fire({ callback: r, quickLaunchOnly: quickLaunchOnly })); + return new Promise(r => this._onRequestAvailableProfiles.fire({ callback: r, configuredProfilesOnly: configuredProfilesOnly })); } private async _whenExtHostReady(remoteAuthority: string): Promise { diff --git a/src/vs/workbench/contrib/terminal/common/terminal.ts b/src/vs/workbench/contrib/terminal/common/terminal.ts index b285af0a3b2b23a746fbea895c94e3b837204447..7e86d9f2d157297ec5c85f9b81f86c33b7a06b03 100644 --- a/src/vs/workbench/contrib/terminal/common/terminal.ts +++ b/src/vs/workbench/contrib/terminal/common/terminal.ts @@ -262,7 +262,7 @@ export type ITerminalProfileObject = ITerminalExecutable | ITerminalProfileSourc export interface IAvailableProfilesRequest { callback: (shells: ITerminalProfile[]) => void; - quickLaunchOnly: boolean; + configuredProfilesOnly: boolean; } export interface IDefaultShellAndArgsRequest { useAutomationShell: boolean; diff --git a/src/vs/workbench/contrib/terminal/node/terminalProfiles.ts b/src/vs/workbench/contrib/terminal/node/terminalProfiles.ts index 6cd8ca11d1442ad03215152a373909644f2252b6..c2a9a4a7996f4c50f6c7d62baafe2f7a96d8098c 100644 --- a/src/vs/workbench/contrib/terminal/node/terminalProfiles.ts +++ b/src/vs/workbench/contrib/terminal/node/terminalProfiles.ts @@ -17,11 +17,11 @@ import * as pfs from 'vs/base/node/pfs'; let profileSources: Map | undefined; -export function detectAvailableProfiles(quickLaunchOnly: boolean, logService?: ILogService, config?: ITerminalConfiguration, variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder, statProvider?: IStatProvider, testPaths?: string[]): Promise { - return platform.isWindows ? detectAvailableWindowsProfiles(quickLaunchOnly, statProvider, logService, config?.displayDetectedWslProfiles, config?.profiles.windows, variableResolver, workspaceFolder) : detectAvailableUnixProfiles(statProvider, logService, quickLaunchOnly, platform.isMacintosh ? config?.profiles.osx : config?.profiles.linux, testPaths, variableResolver, workspaceFolder); +export function detectAvailableProfiles(configuredProfilesOnly: boolean, logService?: ILogService, config?: ITerminalConfiguration, variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder, statProvider?: IStatProvider, testPaths?: string[]): Promise { + return platform.isWindows ? detectAvailableWindowsProfiles(configuredProfilesOnly, statProvider, logService, config?.displayDetectedWslProfiles, config?.profiles.windows, variableResolver, workspaceFolder) : detectAvailableUnixProfiles(statProvider, logService, configuredProfilesOnly, platform.isMacintosh ? config?.profiles.osx : config?.profiles.linux, testPaths, variableResolver, workspaceFolder); } -async function detectAvailableWindowsProfiles(quickLaunchOnly: boolean, statProvider?: IStatProvider, logService?: ILogService, displayDetectedWslProfiles?: boolean, configProfiles?: { [key: string]: ITerminalProfileObject }, variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder): Promise { +async function detectAvailableWindowsProfiles(configuredProfilesOnly: boolean, statProvider?: IStatProvider, logService?: ILogService, displayDetectedWslProfiles?: boolean, configProfiles?: { [key: string]: ITerminalProfileObject }, variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder): Promise { // Determine the correct System32 path. We want to point to Sysnative // when the 32-bit version of VS Code is running on a 64-bit machine. // The reason for this is because PowerShell's important PSReadline @@ -40,7 +40,7 @@ async function detectAvailableWindowsProfiles(quickLaunchOnly: boolean, statProv const detectedProfiles: Map = new Map(); // Add auto detected profiles - if (!quickLaunchOnly) { + if (!configuredProfilesOnly) { detectedProfiles.set('PowerShell', { source: ProfileSource.Pwsh, isAutoDetected: true }); detectedProfiles.set('Git Bash', { source: ProfileSource.GitBash, isAutoDetected: true }); detectedProfiles.set('Cygwin', { @@ -63,7 +63,7 @@ async function detectAvailableWindowsProfiles(quickLaunchOnly: boolean, statProv const resultProfiles: ITerminalProfile[] = await transformToTerminalProfiles(detectedProfiles.entries(), logService, statProvider, variableResolver, workspaceFolder); - if (!quickLaunchOnly || (quickLaunchOnly && displayDetectedWslProfiles)) { + if (!configuredProfilesOnly || (configuredProfilesOnly && displayDetectedWslProfiles)) { resultProfiles.push(... await getWslProfiles(`${system32Path}\\${useWSLexe ? 'wsl.exe' : 'bash.exe'}`, displayDetectedWslProfiles)); } @@ -190,11 +190,11 @@ async function getWslProfiles(wslPath: string, displayDetectedWslProfiles?: bool return []; } -async function detectAvailableUnixProfiles(statProvider?: IStatProvider, logService?: ILogService, quickLaunchOnly?: boolean, configProfiles?: { [key: string]: ITerminalProfileObject }, testPaths?: string[], variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder): Promise { +async function detectAvailableUnixProfiles(statProvider?: IStatProvider, logService?: ILogService, configuredProfilesOnly?: boolean, configProfiles?: { [key: string]: ITerminalProfileObject }, testPaths?: string[], variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder): Promise { const detectedProfiles: Map = new Map(); // Add non-quick launch profiles - if (!quickLaunchOnly) { + if (!configuredProfilesOnly) { const contents = await fs.promises.readFile('/etc/shells', 'utf8'); const profiles = testPaths || contents.split('\n').filter(e => e.trim().indexOf('#') !== 0 && e.trim().length > 0); const counts: Map = new Map();