Merge remote-tracking branch 'origin/master' into tyriar/11275_terminal_refactor

This commit is contained in:
Daniel Imms
2016-09-10 12:01:59 -07:00
9 changed files with 30 additions and 18 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): number { throw ni(); }
$createTerminal(name?: string, shellPath?: string): 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,15 +11,17 @@ 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;
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._id = this._proxy.$createTerminal(name);
this._id = this._proxy.$createTerminal(name, shellPath);
}
public get name(): string {
@@ -64,7 +66,7 @@ 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 {
super();
}
public $createTerminal(name?: string): number {
return this.terminalService.createInstance(name).id;
public $createTerminal(name?: string, shellPath?: string): number {
return this.terminalService.createInstance(name, shellPath).id;
}
public $show(terminalId: number, preserveFocus: boolean): void {