Merge pull request #11700 from Microsoft/octref/10917

Add shellPath to allow user specify preferred shell. Fix #10917
This commit is contained in:
Daniel Imms
2016-09-10 11:47:36 -07:00
committed by GitHub
8 changed files with 43 additions and 24 deletions

View File

@@ -260,8 +260,8 @@ export class ExtHostAPIImplementation {
createOutputChannel(name: string): vscode.OutputChannel {
return extHostOutputService.createOutputChannel(name);
},
createTerminal(name?: string): vscode.Terminal {
return extHostTerminalService.createTerminal(name);
createTerminal(name?: string, shellPath?: string): vscode.Terminal {
return extHostTerminalService.createTerminal(name, shellPath);
}
};

View File

@@ -153,7 +153,7 @@ export abstract class MainThreadOutputServiceShape {
}
export abstract class MainThreadTerminalServiceShape {
$createTerminal(name?: string): TPromise<number> { throw ni(); }
$createTerminal(name?: string, shellPath?: string): TPromise<number> { throw ni(); }
$dispose(terminalId: number): void { throw ni(); }
$hide(terminalId: number): void { throw ni(); }
$sendText(terminalId: number, text: string, addNewLine: boolean): void { throw ni(); }

View File

@@ -11,16 +11,18 @@ import {MainContext, MainThreadTerminalServiceShape} from './extHost.protocol';
export class ExtHostTerminal implements vscode.Terminal {
public _name: string;
public _shellPath: string;
private _id: number;
private _proxy: MainThreadTerminalServiceShape;
private _disposed: boolean;
private _queuedRequests: ApiRequest[] = [];
constructor(proxy: MainThreadTerminalServiceShape, id: number, name?: string) {
constructor(proxy: MainThreadTerminalServiceShape, id: number, name?: string, shellPath?: string) {
this._name = name;
this._shellPath = shellPath;
this._proxy = proxy;
this._proxy.$createTerminal(name).then((terminalId) => {
this._proxy.$createTerminal(name, shellPath).then((terminalId) => {
this._id = terminalId;
this._queuedRequests.forEach((r) => {
r.run(this._proxy, this._id);
@@ -85,8 +87,8 @@ export class ExtHostTerminalService {
this._proxy = threadService.get(MainContext.MainThreadTerminalService);
}
public createTerminal(name?: string): vscode.Terminal {
return new ExtHostTerminal(this._proxy, -1, name);
public createTerminal(name?: string, shellPath?: string): vscode.Terminal {
return new ExtHostTerminal(this._proxy, -1, name, shellPath);
}
}

View File

@@ -19,8 +19,8 @@ export class MainThreadTerminalService extends MainThreadTerminalServiceShape {
this._terminalService = terminalService;
}
public $createTerminal(name?: string): TPromise<number> {
return this._terminalService.createNew(name);
public $createTerminal(name?: string, shellPath?: string): TPromise<number> {
return this._terminalService.createNew(name, shellPath);
}
public $show(terminalId: number, preserveFocus: boolean): void {