From 5d9d2d127fd13d691d0e0730070ba72b37b68bfe Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 9 Apr 2018 07:38:08 -0700 Subject: [PATCH 1/7] Work in progress for exposing all terminals via API --- src/vs/vscode.proposed.d.ts | 8 ++++ .../mainThreadTerminalService.ts | 5 +++ src/vs/workbench/api/node/extHost.api.impl.ts | 3 ++ src/vs/workbench/api/node/extHost.protocol.ts | 1 + .../api/node/extHostTerminalService.ts | 38 ++++++++++++++----- .../parts/terminal/common/terminal.ts | 1 + .../parts/terminal/common/terminalService.ts | 3 ++ .../electron-browser/terminalService.ts | 1 + .../terminal/electron-browser/terminalTab.ts | 2 + 9 files changed, 53 insertions(+), 9 deletions(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index b4a2aabc165..3328a19eabe 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -769,4 +769,12 @@ declare module 'vscode' { } //#endregion + + //#region Terminal + + export namespace window { + export const onDidOpenTerminal: Event; + } + + //#endregion } diff --git a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts index ee934a107b5..3911dc347bd 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts @@ -22,6 +22,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape ) { this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostTerminalService); this._toDispose = []; + this._toDispose.push(terminalService.onInstanceCreated((terminalInstance) => this._onTerminalOpened(terminalInstance))); this._toDispose.push(terminalService.onInstanceDisposed((terminalInstance) => this._onTerminalDisposed(terminalInstance))); this._toDispose.push(terminalService.onInstanceProcessIdReady((terminalInstance) => this._onTerminalProcessIdReady(terminalInstance))); } @@ -78,6 +79,10 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape this._proxy.$acceptTerminalClosed(terminalInstance.id); } + private _onTerminalOpened(terminalInstance: ITerminalInstance): void { + this._proxy.$acceptTerminalOpened(terminalInstance.id, terminalInstance.title); + } + private _onTerminalProcessIdReady(terminalInstance: ITerminalInstance): void { this._proxy.$acceptTerminalProcessId(terminalInstance.id, terminalInstance.processId); } diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index da7a17f7d25..3ccab97e133 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -351,6 +351,9 @@ export function createApiFactory( onDidCloseTerminal(listener, thisArg?, disposables?) { return extHostTerminalService.onDidCloseTerminal(listener, thisArg, disposables); }, + onDidOpenTerminal(listener, thisArg?, disposables?) { + return extHostTerminalService.onDidOpenTerminal(listener, thisArg, disposables); + }, get state() { return extHostWindow.state; }, diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index 44e0ba2ce5b..c2902a8e204 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -728,6 +728,7 @@ export interface ExtHostQuickOpenShape { export interface ExtHostTerminalServiceShape { $acceptTerminalClosed(id: number): void; + $acceptTerminalOpened(id: number, name: string): void; $acceptTerminalProcessId(id: number, processId: number): void; } diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 2a0f3081e2b..c0331705cf5 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -20,12 +20,7 @@ export class ExtHostTerminal implements vscode.Terminal { constructor( proxy: MainThreadTerminalServiceShape, - name?: string, - shellPath?: string, - shellArgs?: string[], - cwd?: string, - env?: { [key: string]: string }, - waitOnExit?: boolean + name?: string ) { this._name = name; this._queuedRequests = []; @@ -33,8 +28,16 @@ export class ExtHostTerminal implements vscode.Terminal { this._pidPromise = new Promise(c => { this._pidPromiseComplete = c; }); + } - this._proxy.$createTerminal(name, shellPath, shellArgs, cwd, env, waitOnExit).then((id) => { + public create( + shellPath?: string, + shellArgs?: string[], + cwd?: string, + env?: { [key: string]: string }, + waitOnExit?: boolean + ): void { + this._proxy.$createTerminal(this._name, shellPath, shellArgs, cwd, env, waitOnExit).then((id) => { this._id = id; this._queuedRequests.forEach((r) => { r.run(this._proxy, this._id); @@ -99,23 +102,27 @@ export class ExtHostTerminal implements vscode.Terminal { export class ExtHostTerminalService implements ExtHostTerminalServiceShape { private readonly _onDidCloseTerminal: Emitter; + private readonly _onDidOpenTerminal: Emitter; private _proxy: MainThreadTerminalServiceShape; private _terminals: ExtHostTerminal[]; constructor(mainContext: IMainContext) { this._onDidCloseTerminal = new Emitter(); + this._onDidOpenTerminal = new Emitter(); this._proxy = mainContext.getProxy(MainContext.MainThreadTerminalService); this._terminals = []; } public createTerminal(name?: string, shellPath?: string, shellArgs?: string[]): vscode.Terminal { - let terminal = new ExtHostTerminal(this._proxy, name, shellPath, shellArgs); + let terminal = new ExtHostTerminal(this._proxy, name); + terminal.create(shellPath, shellArgs); this._terminals.push(terminal); return terminal; } public createTerminalFromOptions(options: vscode.TerminalOptions): vscode.Terminal { - let terminal = new ExtHostTerminal(this._proxy, options.name, options.shellPath, options.shellArgs, options.cwd, options.env /*, options.waitOnExit*/); + let terminal = new ExtHostTerminal(this._proxy, options.name); + terminal.create(options.shellPath, options.shellArgs, options.cwd, options.env /*, options.waitOnExit*/); this._terminals.push(terminal); return terminal; } @@ -124,6 +131,10 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { return this._onDidCloseTerminal && this._onDidCloseTerminal.event; } + public get onDidOpenTerminal(): Event { + return this._onDidOpenTerminal && this._onDidOpenTerminal.event; + } + public $acceptTerminalClosed(id: number): void { let index = this._getTerminalIndexById(id); if (index === null) { @@ -134,6 +145,15 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { this._onDidCloseTerminal.fire(terminal); } + // TOOD: How do we set PID + // TODO: Make sure both API terminals and non-API terminals are created correctly + public $acceptTerminalOpened(id: number, name: string): void { + // TODO: Only create a terminal if it doesn't already exist for the ID + let terminal = new ExtHostTerminal(this._proxy, name); + this._terminals.push(terminal); + this._onDidOpenTerminal.fire(terminal); + } + public $acceptTerminalProcessId(id: number, processId: number): void { let terminal = this._getTerminalById(id); if (terminal) { diff --git a/src/vs/workbench/parts/terminal/common/terminal.ts b/src/vs/workbench/parts/terminal/common/terminal.ts index ed019f21ef7..2fcfe1c89b7 100644 --- a/src/vs/workbench/parts/terminal/common/terminal.ts +++ b/src/vs/workbench/parts/terminal/common/terminal.ts @@ -149,6 +149,7 @@ export interface ITerminalService { configHelper: ITerminalConfigHelper; onActiveTabChanged: Event; onTabDisposed: Event; + onInstanceCreated: Event; onInstanceDisposed: Event; onInstanceProcessIdReady: Event; onInstancesChanged: Event; diff --git a/src/vs/workbench/parts/terminal/common/terminalService.ts b/src/vs/workbench/parts/terminal/common/terminalService.ts index 104182733c6..a3534b05ff0 100644 --- a/src/vs/workbench/parts/terminal/common/terminalService.ts +++ b/src/vs/workbench/parts/terminal/common/terminalService.ts @@ -24,6 +24,7 @@ export abstract class TerminalService implements ITerminalService { protected _terminalContainer: HTMLElement; protected _onInstancesChanged: Emitter; protected _onTabDisposed: Emitter; + protected _onInstanceCreated: Emitter; protected _onInstanceDisposed: Emitter; protected _onInstanceProcessIdReady: Emitter; protected _onInstanceTitleChanged: Emitter; @@ -36,6 +37,7 @@ export abstract class TerminalService implements ITerminalService { public get activeTabIndex(): number { return this._activeTabIndex; } public get onActiveTabChanged(): Event { return this._onActiveTabChanged.event; } public get onTabDisposed(): Event { return this._onTabDisposed.event; } + public get onInstanceCreated(): Event { return this._onInstanceCreated.event; } public get onInstanceDisposed(): Event { return this._onInstanceDisposed.event; } public get onInstanceProcessIdReady(): Event { return this._onInstanceProcessIdReady.event; } public get onInstanceTitleChanged(): Event { return this._onInstanceTitleChanged.event; } @@ -57,6 +59,7 @@ export abstract class TerminalService implements ITerminalService { this._onActiveTabChanged = new Emitter(); this._onTabDisposed = new Emitter(); + this._onInstanceCreated = new Emitter(); this._onInstanceDisposed = new Emitter(); this._onInstanceProcessIdReady = new Emitter(); this._onInstanceTitleChanged = new Emitter(); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts index a09efd1925d..715cf6d3609 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts @@ -82,6 +82,7 @@ export class TerminalService extends AbstractTerminalService implements ITermina // It's the first instance so it should be made active automatically this.setActiveInstanceByIndex(0); } + this._onInstanceCreated.fire(instance); this._onInstancesChanged.fire(); this._suggestShellChange(wasNewTerminalAction); return instance; diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalTab.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalTab.ts index 55eb0c497b3..30b324f6b3d 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalTab.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalTab.ts @@ -402,6 +402,8 @@ export class TerminalTab extends Disposable implements ITerminalTab { shellLaunchConfig); this._terminalInstances.splice(this._activeInstanceIndex + 1, 0, instance); this._initInstanceListeners(instance); + // TODO: Ensure change event is fired + // TODO: Fire create event on service this._setActiveInstance(instance); if (this._splitPaneContainer) { From b1435c13f6f4bf8a1eedb40a07cf6452a3216fde Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 9 Apr 2018 10:28:38 -0700 Subject: [PATCH 2/7] Add terminals --- src/vs/vscode.proposed.d.ts | 5 +++++ src/vs/workbench/api/node/extHost.api.impl.ts | 3 +++ src/vs/workbench/api/node/extHostTerminalService.ts | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 3328a19eabe..0647789fcf5 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -773,6 +773,11 @@ declare module 'vscode' { //#region Terminal export namespace window { + /** + * @readonly + */ + export let terminals: Terminal[]; + export const onDidOpenTerminal: Event; } diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 3ccab97e133..b016a227a71 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -316,6 +316,9 @@ export function createApiFactory( get visibleTextEditors() { return extHostEditors.getVisibleTextEditors(); }, + get terminals() { + return extHostTerminalService.terminals; + }, showTextDocument(documentOrUri: vscode.TextDocument | vscode.Uri, columnOrOptions?: vscode.ViewColumn | vscode.TextDocumentShowOptions, preserveFocus?: boolean): TPromise { let documentPromise: TPromise; if (URI.isUri(documentOrUri)) { diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index c0331705cf5..4950f7cab38 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -106,6 +106,8 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { private _proxy: MainThreadTerminalServiceShape; private _terminals: ExtHostTerminal[]; + public get terminals(): ExtHostTerminal[] { return this._terminals; } + constructor(mainContext: IMainContext) { this._onDidCloseTerminal = new Emitter(); this._onDidOpenTerminal = new Emitter(); From e1b6a8c11f160fd0baa408d9370fab6a4c8839b1 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 9 Apr 2018 11:41:05 -0700 Subject: [PATCH 3/7] Fix terminals showing up twice in new API --- .../mainThreadTerminalService.ts | 7 ++++++- .../api/node/extHostTerminalService.ts | 19 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts index 3911dc347bd..51cd24cb54c 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts @@ -22,7 +22,12 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape ) { this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostTerminalService); this._toDispose = []; - this._toDispose.push(terminalService.onInstanceCreated((terminalInstance) => this._onTerminalOpened(terminalInstance))); + this._toDispose.push(terminalService.onInstanceCreated((terminalInstance) => { + // Delay this message so the TerminalInstance constructor has a change to finish and + // return the ID normally to the extension host. The ID that is passed here will be used + // to register non-extension API terminals in the extension host. + setTimeout(() => this._onTerminalOpened(terminalInstance), 100); + })); this._toDispose.push(terminalService.onInstanceDisposed((terminalInstance) => this._onTerminalDisposed(terminalInstance))); this._toDispose.push(terminalService.onInstanceProcessIdReady((terminalInstance) => this._onTerminalProcessIdReady(terminalInstance))); } diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 4950f7cab38..b6026d73c0c 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -20,11 +20,15 @@ export class ExtHostTerminal implements vscode.Terminal { constructor( proxy: MainThreadTerminalServiceShape, - name?: string + name: string = '', + id?: number ) { - this._name = name; - this._queuedRequests = []; this._proxy = proxy; + this._name = name; + if (id) { + this._id = id; + } + this._queuedRequests = []; this._pidPromise = new Promise(c => { this._pidPromiseComplete = c; }); @@ -149,9 +153,16 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { // TOOD: How do we set PID // TODO: Make sure both API terminals and non-API terminals are created correctly + // TODO: Ensure the terminal that is opened when first launched gets added, I think it's set before the ext host is ready for it public $acceptTerminalOpened(id: number, name: string): void { + let index = this._getTerminalIndexById(id); + if (index !== null) { + // The terminal has already been created (via createTerminal*), only fire the event + this._onDidOpenTerminal.fire(this.terminals[index]); + return; + } // TODO: Only create a terminal if it doesn't already exist for the ID - let terminal = new ExtHostTerminal(this._proxy, name); + let terminal = new ExtHostTerminal(this._proxy, name, id); this._terminals.push(terminal); this._onDidOpenTerminal.fire(terminal); } From d0f6325130ae48fc6a087de134254f5749a1ee58 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 11 Apr 2018 10:04:23 -0700 Subject: [PATCH 4/7] Fix initial terminal API state --- .../api/electron-browser/mainThreadTerminalService.ts | 8 +++++++- src/vs/workbench/parts/terminal/common/terminal.ts | 2 ++ .../parts/terminal/electron-browser/terminalInstance.ts | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts index 51cd24cb54c..e5ad8960095 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts @@ -23,13 +23,19 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostTerminalService); this._toDispose = []; this._toDispose.push(terminalService.onInstanceCreated((terminalInstance) => { - // Delay this message so the TerminalInstance constructor has a change to finish and + // Delay this message so the TerminalInstance constructor has a chance to finish and // return the ID normally to the extension host. The ID that is passed here will be used // to register non-extension API terminals in the extension host. setTimeout(() => this._onTerminalOpened(terminalInstance), 100); })); this._toDispose.push(terminalService.onInstanceDisposed((terminalInstance) => this._onTerminalDisposed(terminalInstance))); this._toDispose.push(terminalService.onInstanceProcessIdReady((terminalInstance) => this._onTerminalProcessIdReady(terminalInstance))); + + // Set initial ext host state + this.terminalService.terminalInstances.forEach(t => { + this._onTerminalOpened(t); + t.processReady.then(() => this._onTerminalProcessIdReady(t)); + }); } public dispose(): void { diff --git a/src/vs/workbench/parts/terminal/common/terminal.ts b/src/vs/workbench/parts/terminal/common/terminal.ts index 2fcfe1c89b7..079e4ac86d7 100644 --- a/src/vs/workbench/parts/terminal/common/terminal.ts +++ b/src/vs/workbench/parts/terminal/common/terminal.ts @@ -235,6 +235,8 @@ export interface ITerminalInstance { onProcessIdReady: Event; + processReady: TPromise; + /** * The title of the terminal. This is either title or the process currently running or an * explicit name given to the terminal instance through the extension API. diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index a7f25db2960..2333fd8b76e 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -107,7 +107,9 @@ export class TerminalInstance implements ITerminalInstance { public disableLayout: boolean; public get id(): number { return this._id; } + // TODO: Ideally processId would be merged into processReady public get processId(): number { return this._processId; } + public get processReady(): TPromise { return this._processReady; } public get onDisposed(): Event { return this._onDisposed.event; } public get onFocused(): Event { return this._onFocused.event; } public get onProcessIdReady(): Event { return this._onProcessIdReady.event; } From 27cd6f537ea29aae0f75783d312c2e1a48218636 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 11 Apr 2018 10:21:32 -0700 Subject: [PATCH 5/7] Allow processId and name access on disposed API Terminals --- src/vs/workbench/api/node/extHostTerminalService.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index b6026d73c0c..d45b8545b09 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -51,12 +51,10 @@ export class ExtHostTerminal implements vscode.Terminal { } public get name(): string { - this._checkDisposed(); return this._name; } public get processId(): Thenable { - this._checkDisposed(); return this._pidPromise; } From 4f626cf21c4954802864a0da27ae7d2759023710 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 11 Apr 2018 10:23:29 -0700 Subject: [PATCH 6/7] Remove obsolete TODOs --- src/vs/workbench/api/node/extHostTerminalService.ts | 4 ---- .../workbench/parts/terminal/electron-browser/terminalTab.ts | 2 -- 2 files changed, 6 deletions(-) diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index d45b8545b09..4e993934fd2 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -149,9 +149,6 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { this._onDidCloseTerminal.fire(terminal); } - // TOOD: How do we set PID - // TODO: Make sure both API terminals and non-API terminals are created correctly - // TODO: Ensure the terminal that is opened when first launched gets added, I think it's set before the ext host is ready for it public $acceptTerminalOpened(id: number, name: string): void { let index = this._getTerminalIndexById(id); if (index !== null) { @@ -159,7 +156,6 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { this._onDidOpenTerminal.fire(this.terminals[index]); return; } - // TODO: Only create a terminal if it doesn't already exist for the ID let terminal = new ExtHostTerminal(this._proxy, name, id); this._terminals.push(terminal); this._onDidOpenTerminal.fire(terminal); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalTab.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalTab.ts index 30b324f6b3d..55eb0c497b3 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalTab.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalTab.ts @@ -402,8 +402,6 @@ export class TerminalTab extends Disposable implements ITerminalTab { shellLaunchConfig); this._terminalInstances.splice(this._activeInstanceIndex + 1, 0, instance); this._initInstanceListeners(instance); - // TODO: Ensure change event is fired - // TODO: Fire create event on service this._setActiveInstance(instance); if (this._splitPaneContainer) { From ce699ee2034919b14cb91340244e6d552ee3961a Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 11 Apr 2018 10:27:35 -0700 Subject: [PATCH 7/7] jsdoc --- src/vs/vscode.proposed.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 0647789fcf5..c519b350ef6 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -774,10 +774,16 @@ declare module 'vscode' { export namespace window { /** + * The currently active terminals or an empty array. + * * @readonly */ export let terminals: Terminal[]; + /** + * An [event](#Event) which fires when a terminal has been created, either through the + * [createTerminal](#window.createTerminal) API or commands. + */ export const onDidOpenTerminal: Event; }