Enable shell selector outside Windows

Fixes #75718
This commit is contained in:
Daniel Imms
2019-06-18 11:28:30 -07:00
parent b3bba0c939
commit 331da82ad5
8 changed files with 30 additions and 27 deletions

View File

@@ -42,7 +42,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this._toDispose.push(_terminalService.onActiveInstanceChanged(instance => this._onActiveTerminalChanged(instance ? instance.id : null)));
this._toDispose.push(_terminalService.onInstanceTitleChanged(instance => this._onTitleChanged(instance.id, instance.title)));
this._toDispose.push(_terminalService.configHelper.onWorkspacePermissionsChanged(isAllowed => this._onWorkspacePermissionsChanged(isAllowed)));
this._toDispose.push(_terminalService.onRequestWindowsShells(r => this._onRequestDetectWindowsShell(r)));
this._toDispose.push(_terminalService.onRequestAvailableShells(r => this._onRequestAvailableShells(r)));
// Set initial ext host state
this._terminalService.terminalInstances.forEach(t => {
@@ -277,7 +277,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this._terminalProcesses[terminalId].emitLatency(sum / COUNT);
}
private _onRequestDetectWindowsShell(resolve: (shells: IShellDefinition[]) => void): void {
this._proxy.$requestWindowsShells().then(shells => resolve(shells));
private _onRequestAvailableShells(resolve: (shells: IShellDefinition[]) => void): void {
this._proxy.$requestAvailableShells().then(shells => resolve(shells));
}
}

View File

@@ -1128,7 +1128,7 @@ export interface ExtHostTerminalServiceShape {
$acceptProcessRequestCwd(id: number): void;
$acceptProcessRequestLatency(id: number): number;
$acceptWorkspacePermissionsChanged(isAllowed: boolean): void;
$requestWindowsShells(): Promise<IShellDefinitionDto[]>;
$requestAvailableShells(): Promise<IShellDefinitionDto[]>;
}
export interface ExtHostSCMShape {

View File

@@ -20,7 +20,7 @@ import { ExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace';
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { ExtHostVariableResolverService } from 'vs/workbench/api/node/extHostDebugService';
import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors';
import { getDefaultShell, detectWindowsShells } from 'vs/workbench/contrib/terminal/node/terminal';
import { getDefaultShell, detectAvailableShells } from 'vs/workbench/contrib/terminal/node/terminal';
const RENDERER_NO_PROCESS_ID = -1;
@@ -575,11 +575,8 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
return id;
}
public $requestWindowsShells(): Promise<IShellDefinitionDto[]> {
if (!platform.isWindows) {
throw new Error('Can only detect Windows shells on Windows');
}
return detectWindowsShells();
public $requestAvailableShells(): Promise<IShellDefinitionDto[]> {
return detectAvailableShells();
}
private _onProcessExit(id: number, exitCode: number): void {