diff --git a/package.json b/package.json index 5153b58461..283cb34d25 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "publisher": "ms-vscode", "description": "Develop PowerShell scripts in Visual Studio Code!", "engines": { - "vscode": "^1.25.0" + "vscode": "^1.29.0" }, "license": "SEE LICENSE IN LICENSE.txt", "homepage": "https://github.com/PowerShell/vscode-powershell/blob/master/README.md", @@ -46,8 +46,8 @@ "mocha": "~4.0.1", "tslint": "~5.11.0", "typescript": "~3.2.1", - "vsce": "~1.46.0", - "vscode": "~1.1.22" + "vsce": "~1.53.2", + "vscode": "~1.1.24" }, "extensionDependencies": [ "vscode.powershell" diff --git a/src/features/Console.ts b/src/features/Console.ts index 70ae72a7a8..cedeb37769 100644 --- a/src/features/Console.ts +++ b/src/features/Console.ts @@ -7,6 +7,7 @@ import { LanguageClient, NotificationType, RequestType } from "vscode-languagecl import { ICheckboxQuickPickItem, showCheckboxQuickPick } from "../controls/checkboxQuickPick"; import { IFeature } from "../feature"; import { Logger } from "../logging"; +import Settings = require("../settings"); export const EvaluateRequestType = new RequestType("evaluate"); export const OutputNotificationType = new NotificationType("output"); @@ -210,6 +211,19 @@ export class ConsoleFeature implements IFeature { return; } + if (vscode.window.activeTerminal.name !== "PowerShell Integrated Console") { + this.log.write("PSIC is not active terminal. Running in active terminal using 'runSelectedText'"); + await vscode.commands.executeCommand("workbench.action.terminal.runSelectedText"); + + // We need to honor the focusConsoleOnExecute setting here too. However, the boolean that `show` + // takes is called `preserveFocus` which when `true` the terminal will not take focus. + // This is the inverse of focusConsoleOnExecute so we have to inverse the boolean. + vscode.window.activeTerminal.show(!Settings.load().integratedConsole.focusConsoleOnExecute); + await vscode.commands.executeCommand("workbench.action.terminal.scrollToBottom"); + + return; + } + const editor = vscode.window.activeTextEditor; let selectionRange: vscode.Range;