mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
@@ -309,15 +309,16 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
|
||||
return true;
|
||||
}
|
||||
|
||||
private async _onRequestAvailableShells(callback: IAvailableShellsRequest): Promise<void> {
|
||||
private async _onRequestAvailableShells(req: IAvailableShellsRequest): Promise<void> {
|
||||
if (this._isPrimaryExtHost()) {
|
||||
callback(await this._proxy.$getAvailableShells());
|
||||
req.callback(await this._proxy.$getAvailableShells());
|
||||
}
|
||||
}
|
||||
|
||||
private _onRequestDefaultShellAndArgs(request: IDefaultShellAndArgsRequest): void {
|
||||
private async _onRequestDefaultShellAndArgs(req: IDefaultShellAndArgsRequest): Promise<void> {
|
||||
if (this._isPrimaryExtHost()) {
|
||||
this._proxy.$requestDefaultShellAndArgs(request.useAutomationShell).then(e => request.callback(e.shell, e.args));
|
||||
const res = await this._proxy.$getDefaultShellAndArgs(req.useAutomationShell);
|
||||
req.callback(res.shell, res.args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1288,7 +1288,7 @@ export interface ExtHostTerminalServiceShape {
|
||||
$acceptProcessRequestLatency(id: number): number;
|
||||
$acceptWorkspacePermissionsChanged(isAllowed: boolean): void;
|
||||
$getAvailableShells(): Promise<IShellDefinitionDto[]>;
|
||||
$requestDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto>;
|
||||
$getDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto>;
|
||||
}
|
||||
|
||||
export interface ExtHostSCMShape {
|
||||
|
||||
@@ -326,7 +326,7 @@ export abstract class BaseExtHostTerminalService implements IExtHostTerminalServ
|
||||
public abstract getDefaultShellArgs(useAutomationShell: boolean, configProvider: ExtHostConfigProvider): string[] | string;
|
||||
public abstract $spawnExtHostProcess(id: number, shellLaunchConfigDto: IShellLaunchConfigDto, activeWorkspaceRootUriComponents: UriComponents, cols: number, rows: number, isWorkspaceShellAllowed: boolean): Promise<void>;
|
||||
public abstract $getAvailableShells(): Promise<IShellDefinitionDto[]>;
|
||||
public abstract $requestDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto>;
|
||||
public abstract $getDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto>;
|
||||
public abstract $acceptWorkspacePermissionsChanged(isAllowed: boolean): void;
|
||||
|
||||
public createExtensionTerminal(options: vscode.ExtensionTerminalOptions): vscode.Terminal {
|
||||
@@ -610,7 +610,7 @@ export class WorkerExtHostTerminalService extends BaseExtHostTerminalService {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
|
||||
public async $requestDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto> {
|
||||
public async $getDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto> {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ export class ExtHostTask extends ExtHostTaskBase {
|
||||
}
|
||||
|
||||
public $getDefaultShellAndArgs(): Promise<{ shell: string, args: string[] | string | undefined }> {
|
||||
return this._terminalService.$requestDefaultShellAndArgs(true);
|
||||
return this._terminalService.$getDefaultShellAndArgs(true);
|
||||
}
|
||||
|
||||
public async $jsonTasksSupported(): Promise<boolean> {
|
||||
|
||||
@@ -204,12 +204,12 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
|
||||
return detectAvailableShells();
|
||||
}
|
||||
|
||||
public async $requestDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto> {
|
||||
public async $getDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto> {
|
||||
const configProvider = await this._extHostConfiguration.getConfigProvider();
|
||||
return Promise.resolve({
|
||||
return {
|
||||
shell: this.getDefaultShell(useAutomationShell, configProvider),
|
||||
args: this.getDefaultShellArgs(useAutomationShell, configProvider)
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
public $acceptWorkspacePermissionsChanged(isAllowed: boolean): void {
|
||||
|
||||
Reference in New Issue
Block a user