Skip to content

Commit 01e8ef8

Browse files
Fix new suppress terminal setting (#5463)
Behaviorally it was working, but it wasn't showing up in the settings. We also hadn't mapped it into our (pointless IMHO) `Settings` class, or put it under the "correct" section of `integratedConsole`. To be honest, it's open work to migrate away from `getSettings()` and to just using the VS Code APIs directly, but we shouldn't do it now.
1 parent 12c8737 commit 01e8ef8

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@
10471047
"default": false,
10481048
"markdownDescription": "Do not show the startup banner in the PowerShell Extension Terminal."
10491049
},
1050-
"powershell.suppressTerminalStoppedNotification": {
1050+
"powershell.integratedConsole.suppressTerminalStoppedNotification": {
10511051
"type": "boolean",
10521052
"default": false,
10531053
"markdownDescription": "Do not show a notification when the PowerShell Extension Terminal has stopped."

src/session.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,13 +1159,9 @@ Type 'help' to get help.
11591159
}
11601160

11611161
private async promptForRestart(): Promise<void> {
1162-
// Check user configuration before showing notification
1163-
const suppressNotification =
1164-
vscode.workspace
1165-
.getConfiguration("powershell")
1166-
.get<boolean>("suppressTerminalStoppedNotification") ?? false;
1167-
1168-
if (suppressNotification) {
1162+
if (
1163+
getSettings().integratedConsole.suppressTerminalStoppedNotification
1164+
) {
11691165
return;
11701166
}
11711167

@@ -1186,7 +1182,7 @@ Type 'help' to get help.
11861182
prompt: "Don't Show Again",
11871183
action: async (): Promise<void> => {
11881184
await changeSetting(
1189-
"suppressTerminalStoppedNotification",
1185+
"integratedConsole.suppressTerminalStoppedNotification",
11901186
true,
11911187
true,
11921188
this.logger,

src/settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class IntegratedConsoleSettings extends PartialSettings {
133133
useLegacyReadLine = false;
134134
forceClearScrollbackBuffer = false;
135135
suppressStartupBanner = false;
136+
suppressTerminalStoppedNotification = false;
136137
startLocation = StartLocation.Panel;
137138
}
138139

0 commit comments

Comments
 (0)