From 7b5cf12dc9efe47388d792b254b3fb8ec77d4b44 Mon Sep 17 00:00:00 2001 From: Darlington Ogbuefi Date: Sun, 18 Jan 2026 16:05:09 +0000 Subject: [PATCH 1/2] Add setting to disable incessant PowerShell Extension Terminal Stopped notifications --- package.json | 5 +++++ src/session.ts | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/package.json b/package.json index f65cde26af..e53fa92ecf 100644 --- a/package.json +++ b/package.json @@ -1043,6 +1043,11 @@ "default": false, "markdownDescription": "Do not show the startup banner in the PowerShell Extension Terminal." }, + "powershell.showTerminalStoppedNotification": { + "type": "boolean", + "default": true, + "markdownDescription": "Show a notification when the PowerShell Extension terminal has stopped." + }, "powershell.integratedConsole.showOnStartup": { "type": "boolean", "default": true, diff --git a/src/session.ts b/src/session.ts index b5b201a601..b774e048f3 100644 --- a/src/session.ts +++ b/src/session.ts @@ -1158,6 +1158,15 @@ Type 'help' to get help. } private async promptForRestart(): Promise { + // Check user configuration before showing notification + const showNotifications = vscode.workspace + .getConfiguration("powershell") + .get("showTerminalStoppedNotification", true); + + if (!showNotifications) { + // User opted out — silently skip the notification + return; + } await this.logger.writeAndShowErrorWithActions( "The PowerShell Extension Terminal has stopped, would you like to restart it? IntelliSense and other features will not work without it!", [ From cb1c05b698c51a9aed18a6c5ad5600e3e03dbe81 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Wed, 8 Apr 2026 11:07:16 -0700 Subject: [PATCH 2/2] Improve PowerShell Extension termination experience We can now suppress the LSP library's duplicate notification, and we provide a promptable action to suppress our own. --- package.json | 6 +++--- src/session.ts | 25 +++++++++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index e53fa92ecf..015eaedcd2 100644 --- a/package.json +++ b/package.json @@ -1043,10 +1043,10 @@ "default": false, "markdownDescription": "Do not show the startup banner in the PowerShell Extension Terminal." }, - "powershell.showTerminalStoppedNotification": { + "powershell.suppressTerminalStoppedNotification": { "type": "boolean", - "default": true, - "markdownDescription": "Show a notification when the PowerShell Extension terminal has stopped." + "default": false, + "markdownDescription": "Do not show a notification when the PowerShell Extension Terminal has stopped." }, "powershell.integratedConsole.showOnStartup": { "type": "boolean", diff --git a/src/session.ts b/src/session.ts index b774e048f3..2908f6d27f 100644 --- a/src/session.ts +++ b/src/session.ts @@ -980,7 +980,8 @@ export class SessionManager implements Middleware { return { action: CloseAction.DoNotRestart, message: - "Connection to PowerShell Editor Services (the Extension Terminal) was closed. See below prompt to restart!", + "Connection to PowerShell Editor Services (the Extension Terminal) was closed.", + handled: true, }; }, }, @@ -1159,14 +1160,15 @@ Type 'help' to get help. private async promptForRestart(): Promise { // Check user configuration before showing notification - const showNotifications = vscode.workspace - .getConfiguration("powershell") - .get("showTerminalStoppedNotification", true); + const suppressNotification = + vscode.workspace + .getConfiguration("powershell") + .get("suppressTerminalStoppedNotification") ?? false; - if (!showNotifications) { - // User opted out — silently skip the notification + if (suppressNotification) { return; } + await this.logger.writeAndShowErrorWithActions( "The PowerShell Extension Terminal has stopped, would you like to restart it? IntelliSense and other features will not work without it!", [ @@ -1180,6 +1182,17 @@ Type 'help' to get help. prompt: "No", action: undefined, }, + { + prompt: "Don't Show Again", + action: async (): Promise => { + await changeSetting( + "suppressTerminalStoppedNotification", + true, + true, + this.logger, + ); + }, + }, ], ); }