diff --git a/src/vs/workbench/api/common/extHostTerminalService.ts b/src/vs/workbench/api/common/extHostTerminalService.ts index 9d81c5b30cb..bccacd0543f 100644 --- a/src/vs/workbench/api/common/extHostTerminalService.ts +++ b/src/vs/workbench/api/common/extHostTerminalService.ts @@ -123,16 +123,16 @@ export class ExtHostTerminal extends BaseExtHostTerminal implements vscode.Termi strictEnv?: boolean, hideFromUser?: boolean ): Promise { - const terminal = await this._proxy.$createTerminal({ name: this._name, shellPath, shellArgs, cwd, env, waitOnExit, strictEnv, hideFromUser }); - this._name = terminal.name; - this._runQueuedRequests(terminal.id); + const result = await this._proxy.$createTerminal({ name: this._name, shellPath, shellArgs, cwd, env, waitOnExit, strictEnv, hideFromUser }); + this._name = result.name; + this._runQueuedRequests(result.id); } public async createExtensionTerminal(): Promise { - const terminal = await this._proxy.$createTerminal({ name: this._name, isExtensionTerminal: true }); - this._name = terminal.name; - this._runQueuedRequests(terminal.id); - return terminal.id; + const result = await this._proxy.$createTerminal({ name: this._name, isExtensionTerminal: true }); + this._name = result.name; + this._runQueuedRequests(result.id); + return result.id; } public get name(): string { diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index ca790979d28..d7809338f81 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -46,15 +46,15 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService { public createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string): vscode.Terminal { const terminal = new ExtHostTerminal(this._proxy, { name, shellPath, shellArgs }, name); - terminal.create(shellPath, shellArgs); this._terminals.push(terminal); + terminal.create(shellPath, shellArgs); return terminal; } public createTerminalFromOptions(options: vscode.TerminalOptions): vscode.Terminal { const terminal = new ExtHostTerminal(this._proxy, options, options.name); - terminal.create(options.shellPath, options.shellArgs, options.cwd, options.env, /*options.waitOnExit*/ undefined, options.strictEnv, options.hideFromUser); this._terminals.push(terminal); + terminal.create(options.shellPath, options.shellArgs, options.cwd, options.env, /*options.waitOnExit*/ undefined, options.strictEnv, options.hideFromUser); return terminal; }