From beaab9ae6c22a7c7318e19fb52a1ada730ef8d14 Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Sun, 8 Jul 2018 13:52:36 -0600 Subject: [PATCH] Scroll the terminal to bottom for F8 executionPartial fix #1257 --- src/features/Console.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/features/Console.ts b/src/features/Console.ts index 29a7eda457..fdb93f83c2 100644 --- a/src/features/Console.ts +++ b/src/features/Console.ts @@ -202,7 +202,7 @@ export class ConsoleFeature implements IFeature { constructor() { this.commands = [ - vscode.commands.registerCommand("PowerShell.RunSelection", () => { + vscode.commands.registerCommand("PowerShell.RunSelection", async () => { if (this.languageClient === undefined) { // TODO: Log error message return; @@ -224,8 +224,10 @@ export class ConsoleFeature implements IFeature { expression: editor.document.getText(selectionRange), }); - // Show the integrated console if it isn't already visible - vscode.commands.executeCommand("PowerShell.ShowSessionConsole", true); + // Show the integrated console if it isn't already visible and + // scroll terminal to bottom so new output is visible + await vscode.commands.executeCommand("PowerShell.ShowSessionConsole", true); + await vscode.commands.executeCommand("workbench.action.terminal.scrollToBottom"); }), ]; }