diff --git a/src/Terminal.ts b/src/Terminal.ts index 98780f5c..1dbbbc5f 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -485,6 +485,7 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT this.viewport.syncScrollArea(); break; case 'tabStopWidth': this.setupStops(); break; + case 'bellSound': this.syncBellSound(); break; case 'bellStyle': this.preloadBellSound(); break; } } @@ -2303,6 +2304,12 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT this.helperContainer.removeChild(this.bellAudioElement); } } + + private syncBellSound(): void { + if (this.soundBell() && this.bellAudioElement) { + this.bellAudioElement.setAttribute('src', this.options.bellSound); + } + } } /** diff --git a/src/Types.ts b/src/Types.ts index c287030d..c1cf9e63 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -31,6 +31,7 @@ export type BooleanOption = export type StringOption = 'cursorStyle' | 'bellStyle' | + 'bellSound' | 'termName'; export type StringArrayOption = 'colors'; export type NumberOption =