FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve PowerShell Extension termination experience by darlingtonogbuefi · Pull Request #5380 · PowerShell/vscode-powershell · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .json  (1) .ts  (1) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 5 additions & 0 deletions package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,11 @@
"default": false,
"markdownDescription": "Do not show the startup banner in the PowerShell Extension Terminal."
},
"powershell.suppressTerminalStoppedNotification": {
"type": "boolean",
"default": false,
"markdownDescription": "Do not show a notification when the PowerShell Extension Terminal has stopped."
},
"powershell.integratedConsole.showOnStartup": {
"type": "boolean",
"default": true,
Expand Down
24 changes: 23 additions & 1 deletion src/session.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
},
},
Expand Down Expand Up @@ -1158,6 +1159,16 @@ Type 'help' to get help.
}

private async promptForRestart(): Promise<void> {
// Check user configuration before showing notification
const suppressNotification =
vscode.workspace
.getConfiguration("powershell")
.get<boolean>("suppressTerminalStoppedNotification") ?? false;

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!",
[
Expand All @@ -1171,6 +1182,17 @@ Type 'help' to get help.
prompt: "No",
action: undefined,
},
{
prompt: "Don't Show Again",
action: async (): Promise<void> => {
await changeSetting(
"suppressTerminalStoppedNotification",
true,
true,
this.logger,
);
},
},
],
);
}
Expand Down
Loading

Back | FazBrowse Home | New Git URL