From 20b3ee42d8d9cdd287f903bb858d955fea57ab31 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 15 Dec 2017 11:35:43 +0100 Subject: [PATCH] Fix #40281 --- .../parts/output/browser/outputServices.ts | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/parts/output/browser/outputServices.ts b/src/vs/workbench/parts/output/browser/outputServices.ts index 5e67c1e3bde..284791a1f63 100644 --- a/src/vs/workbench/parts/output/browser/outputServices.ts +++ b/src/vs/workbench/parts/output/browser/outputServices.ts @@ -277,8 +277,8 @@ export class OutputService implements IOutputService { } this.activeChannelId = id; - return this.doShowChannel(id, preserveFocus) - .then(() => this._onActiveOutputChannel.fire(id)); + const promise: TPromise = this._outputPanel ? this.doShowChannel(id, preserveFocus) : this.panelService.openPanel(OUTPUT_PANEL_ID); + return promise.then(() => this._onActiveOutputChannel.fire(id)); } showChannelInEditor(channelId: string): TPromise { @@ -342,15 +342,19 @@ export class OutputService implements IOutputService { } private doShowChannel(channelId: string, preserveFocus: boolean): TPromise { - const channel = this.getChannel(channelId); - return channel.show() - .then(() => { - this.storageService.store(OUTPUT_ACTIVE_CHANNEL_KEY, channelId, StorageScope.WORKSPACE); - this._outputPanel.setInput(this.createInput(channelId), EditorOptions.create({ preserveFocus: preserveFocus })); - if (!preserveFocus) { - this._outputPanel.focus(); - } - }); + if (this._outputPanel) { + const channel = this.getChannel(channelId); + return channel.show() + .then(() => { + this.storageService.store(OUTPUT_ACTIVE_CHANNEL_KEY, channelId, StorageScope.WORKSPACE); + this._outputPanel.setInput(this.createInput(channelId), EditorOptions.create({ preserveFocus: preserveFocus })); + if (!preserveFocus) { + this._outputPanel.focus(); + } + }); + } else { + return TPromise.as(null); + } } private doHideChannel(channelId): void { -- GitLab