Terminal profiles (#118790)

* get basics working in current dropdown

* filter profiles based on what we want in the dropdown and other info

* add copywright

* terminal.ts -> terminalProfile.ts

* seperate linux distro code

* improve terminalConfig setting description

* add passing tests and fix #79572

* add test for login args

* add wsl stuff

* fix #77652

* lengthen throttle time to 10s

* shell -> process and fire update profiles so dropdown is updated

* consolidate code in terminalProfile

* change profile selection logic

* change profile config structure

* use <ProfileName, IterminalProfileObject> and get wsl distro names to look normal

* provide terminalConfig to terminalProfiles

* move detection/validation to terminalProfiles

* isWorkspaceShellAllowed

* add quickPickOnly so Select Default Profiles returns all and otherwise filters based on config

* Add logs for errors within terminalProfiles

* change return type

* use sync

* fix bug, get custom generated to work

* workspace shell permissions

* add some comments and clean up

* when ext host ready update profiles

* improve terminalProfileObjectEqual check

* don't use windows powershell unless no other powershell
This commit is contained in:
Megan Rogge
2021-03-16 19:02:59 -05:00
committed by GitHub
parent e5fc49d8af
commit e8e6d64105
15 changed files with 628 additions and 181 deletions

View File

@@ -15,7 +15,7 @@ import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ITerminalExternalLinkProvider, ITerminalInstance, ITerminalInstanceService, ITerminalLink, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
import { IEnvironmentVariableService, ISerializableEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariable';
import { deserializeEnvironmentVariableCollection, serializeEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariableShared';
import { IAvailableShellsRequest, IDefaultShellAndArgsRequest, IStartExtensionTerminalRequest, ITerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/common/terminal';
import { IAvailableProfilesRequest as IAvailableProfilesRequest, IDefaultShellAndArgsRequest, IStartExtensionTerminalRequest, ITerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/common/terminal';
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
@extHostNamedCustomer(MainContext.MainThreadTerminalService)
@@ -66,7 +66,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this._toDispose.add(_terminalService.onActiveInstanceChanged(instance => this._onActiveTerminalChanged(instance ? instance.instanceId : null)));
this._toDispose.add(_terminalService.onInstanceTitleChanged(instance => instance && this._onTitleChanged(instance.instanceId, instance.title)));
this._toDispose.add(_terminalService.configHelper.onWorkspacePermissionsChanged(isAllowed => this._onWorkspacePermissionsChanged(isAllowed)));
this._toDispose.add(_terminalService.onRequestAvailableShells(e => this._onRequestAvailableShells(e)));
this._toDispose.add(_terminalService.onRequestAvailableProfiles(e => this._onRequestAvailableProfiles(e)));
// ITerminalInstanceService listeners
if (terminalInstanceService.onRequestDefaultShellAndArgs) {
@@ -349,9 +349,9 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
return true;
}
private async _onRequestAvailableShells(req: IAvailableShellsRequest): Promise<void> {
private async _onRequestAvailableProfiles(req: IAvailableProfilesRequest): Promise<void> {
if (this._isPrimaryExtHost()) {
req.callback(await this._proxy.$getAvailableShells());
req.callback(await this._proxy.$getAvailableProfiles(req.quickLaunchOnly));
}
}