Skip to content

Commit dadf970

Browse files
committed
outputServices.showOutput do nothing if the correct panel is already revealed
fixes microsoft#3609
1 parent 6438f68 commit dadf970

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/vs/workbench/parts/output/common/outputServices.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,14 @@ export class OutputService implements IOutputService {
117117
}
118118

119119
public showOutput(channel: string, preserveFocus?: boolean): TPromise<IEditor> {
120+
const panel = this.panelService.getActivePanel();
121+
if (this.activeChannel === channel && panel && panel.getId() === OUTPUT_PANEL_ID) {
122+
return TPromise.as(<OutputPanel>panel);
123+
}
124+
120125
this.activeChannel = channel;
121126
this.storageService.store(OUTPUT_ACTIVE_CHANNEL_KEY, this.activeChannel, StorageScope.WORKSPACE);
122-
this._onActiveOutputChannel.fire(channel); // emit event that we a new channel is active
127+
this._onActiveOutputChannel.fire(channel); // emit event that a new channel is active
123128

124129
return this.panelService.openPanel(OUTPUT_PANEL_ID, !preserveFocus).then((outputPanel: OutputPanel) => {
125130
return outputPanel && outputPanel.setInput(OutputEditorInput.getInstance(this.instantiationService, channel), EditorOptions.create({ preserveFocus: preserveFocus })).

0 commit comments

Comments
 (0)