diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index e808e1b8f7d..fd4037c5388 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -2976,6 +2976,13 @@ declare namespace vscode { */ export interface Terminal { + /** + * The name of the terminal. + * + * @readonly + */ + name: string; + /** * Send text to the terminal. * diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 3359f93ec54..0093c2a9fdb 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -11,11 +11,14 @@ import {MainContext, MainThreadTerminalServiceShape} from './extHost.protocol'; export class ExtHostTerminal implements vscode.Terminal { + public name: string; + private _id: number; private _proxy: MainThreadTerminalServiceShape; private _disposed: boolean; - constructor(proxy: MainThreadTerminalServiceShape, id: number) { + constructor(proxy: MainThreadTerminalServiceShape, id: number, name?: string) { + this.name = name; this._id = id; this._proxy = proxy; } @@ -50,7 +53,7 @@ export class ExtHostTerminalService { public createTerminal(name?: string): TPromise { return this._proxy.$createTerminal(name).then((terminalId) => { - return new ExtHostTerminal(this._proxy, terminalId); + return new ExtHostTerminal(this._proxy, terminalId, name); }); } }