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

@@ -5,7 +5,7 @@
import type * as vscode from 'vscode';
import { Event, Emitter } from 'vs/base/common/event';
import { ExtHostTerminalServiceShape, MainContext, MainThreadTerminalServiceShape, IShellLaunchConfigDto, IShellDefinitionDto, IShellAndArgsDto, ITerminalDimensionsDto, ITerminalLinkDto, TerminalIdentifier } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostTerminalServiceShape, MainContext, MainThreadTerminalServiceShape, IShellLaunchConfigDto, IShellAndArgsDto, ITerminalDimensionsDto, ITerminalLinkDto, TerminalIdentifier } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostConfigProvider } from 'vs/workbench/api/common/extHostConfiguration';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { URI } from 'vs/base/common/uri';
@@ -21,6 +21,7 @@ import { generateUuid } from 'vs/base/common/uuid';
import { ISerializableEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariable';
import { ITerminalChildProcess, ITerminalDimensionsOverride, ITerminalLaunchError, TerminalShellType } from 'vs/platform/terminal/common/terminal';
import { TerminalDataBufferer } from 'vs/platform/terminal/common/terminalDataBuffering';
import { ITerminalProfile } from 'vs/workbench/contrib/terminal/common/terminal';
export interface IExtHostTerminalService extends ExtHostTerminalServiceShape, IDisposable {
@@ -327,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 $getAvailableShells(): Promise<IShellDefinitionDto[]>;
public abstract $getAvailableProfiles(quickLaunchOnly: boolean): Promise<ITerminalProfile[]>;
public abstract $getDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto>;
public abstract $acceptWorkspacePermissionsChanged(isAllowed: boolean): void;
@@ -778,7 +779,7 @@ export class WorkerExtHostTerminalService extends BaseExtHostTerminalService {
throw new NotSupportedError();
}
public $getAvailableShells(): Promise<IShellDefinitionDto[]> {
public $getAvailableProfiles(quickLaunchOnly: boolean): Promise<ITerminalProfile[]> {
throw new NotSupportedError();
}