diff --git a/src/Terminal.ts b/src/Terminal.ts index d08ae73c..49b451ba 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -1568,10 +1568,19 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp this.textarea.value = ''; } - this._keyDownHandled = true; this._onKey.fire({ key: result.key, domEvent: event }); this.showCursor(); this._coreService.triggerDataEvent(result.key, true); + + // Cancel events when not in screen reader mode so events don't get bubbled up and handled by + // other listeners. When screen reader mode is enabled, this could cause issues if the event + // is handled at a higher level, this is a compromise in order to echo keys to the screen + // reader. + if (!this.optionsService.options.screenReaderMode) { + return this.cancel(event, true); + } + + this._keyDownHandled = true; } private _isThirdLevelShift(browser: IBrowser, ev: IKeyboardEvent): boolean {