Skip to content

Commit cf21f5d

Browse files
committed
Focus output editor only if hidden
1 parent 814aca9 commit cf21f5d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/features/Console.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ export function registerConsoleCommands(client: LanguageClient): void {
3737

3838
var consoleChannel = vscode.window.createOutputChannel("PowerShell Output");
3939
client.onNotification(OutputNotification.type, (output) => {
40-
consoleChannel.show(vscode.ViewColumn.Three);
40+
var outputEditorExist = vscode.window.visibleTextEditors.some((editor) => {
41+
return editor.document.languageId == 'Log'
42+
});
43+
if(!outputEditorExist)
44+
consoleChannel.show(vscode.ViewColumn.Three);
4145
consoleChannel.append(output.output);
4246
});
43-
}
47+
}

0 commit comments

Comments
 (0)