Skip to content

Commit a85dd8c

Browse files
committed
1 parent a3ab3b4 commit a85dd8c

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

src/vs/platform/terminal/common/terminal.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export const enum TerminalSettingId {
7979
ConfirmOnExit = 'terminal.integrated.confirmOnExit',
8080
ConfirmOnKill = 'terminal.integrated.confirmOnKill',
8181
EnableBell = 'terminal.integrated.enableBell',
82+
EnableVisualBell = 'terminal.integrated.enableVisualBell',
8283
CommandsToSkipShell = 'terminal.integrated.commandsToSkipShell',
8384
AllowChords = 'terminal.integrated.allowChords',
8485
AllowMnemonics = 'terminal.integrated.allowMnemonics',

src/vs/workbench/contrib/terminal/browser/terminalInstance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
754754
// starts up or reconnects
755755
disposableTimeout(() => {
756756
this._register(xterm.raw.onBell(() => {
757-
if (this._configHelper.config.enableBell) {
757+
if (this._configurationService.getValue(TerminalSettingId.EnableBell) || this._configurationService.getValue(TerminalSettingId.EnableVisualBell)) {
758758
this.statusList.add({
759759
id: TerminalStatus.Bell,
760760
severity: Severity.Warning,

src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
1212
import { Codicon } from 'vs/base/common/codicons';
1313
import { terminalColorSchema, terminalIconSchema } from 'vs/platform/terminal/common/terminalPlatformConfiguration';
1414
import product from 'vs/platform/product/common/product';
15+
import { Extensions as WorkbenchExtensions, IConfigurationMigrationRegistry, ConfigurationKeyValuePairs } from 'vs/workbench/common/configuration';
1516

1617
const terminalDescriptors = '\n- ' + [
1718
'`\${cwd}`: ' + localize("cwd", "the terminal's current working directory"),
@@ -364,7 +365,12 @@ const terminalConfiguration: IConfigurationNode = {
364365
default: 'editor'
365366
},
366367
[TerminalSettingId.EnableBell]: {
367-
description: localize('terminal.integrated.enableBell', "Controls whether the terminal bell is enabled. This shows up as a visual bell next to the terminal's name."),
368+
markdownDeprecationMessage: localize('terminal.integrated.enableBell', "This is now deprecated. Instead use the `terminal.integrated.enableVisualBell` and `accessibility.signals.terminalBell` settings."),
369+
type: 'boolean',
370+
default: false
371+
},
372+
[TerminalSettingId.EnableVisualBell]: {
373+
description: localize('terminal.integrated.enableVisualBell', "Controls whether the visual terminal bell is enabled. This shows up next to the terminal's name."),
368374
type: 'boolean',
369375
default: false
370376
},
@@ -660,3 +666,20 @@ export function registerTerminalConfiguration() {
660666
const configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);
661667
configurationRegistry.registerConfiguration(terminalConfiguration);
662668
}
669+
670+
Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
671+
.registerConfigurationMigrations([{
672+
key: TerminalSettingId.EnableBell,
673+
migrateFn: (enableBell, accessor) => {
674+
const configurationKeyValuePairs: ConfigurationKeyValuePairs = [];
675+
configurationKeyValuePairs.push([TerminalSettingId.EnableBell, { value: undefined }]);
676+
let announcement = accessor('accessibility.signals.terminalBell')?.announcement ?? accessor('accessibility.alert.terminalBell');
677+
if (announcement !== undefined && typeof announcement !== 'string') {
678+
announcement = announcement ? 'auto' : 'off';
679+
}
680+
configurationKeyValuePairs.push(['accessibility.signals.terminalBell', { value: { sound: enableBell ? 'on' : 'off', announcement } }]);
681+
configurationKeyValuePairs.push([TerminalSettingId.EnableBell, { value: undefined }]);
682+
configurationKeyValuePairs.push([TerminalSettingId.EnableVisualBell, { value: enableBell }]);
683+
return configurationKeyValuePairs;
684+
}
685+
}]);

0 commit comments

Comments
 (0)