actually fix mouse handler before term attached

This commit is contained in:
Sebastian Pfitzner
2019-02-26 11:31:22 +01:00
parent 6ad6a01c3f
commit 0854f84653
2 changed files with 11 additions and 2 deletions
+6 -2
View File
@@ -1284,7 +1284,9 @@ export class InputHandler extends Disposable implements IInputHandler {
if (this._terminal.element) {
this._terminal.element.classList.add('enable-mouse-events');
}
this._terminal.selectionManager.disable();
if (this._terminal.selectionManager) {
this._terminal.selectionManager.disable();
}
this._terminal.log('Binding to mouse events.');
break;
case 1004: // send focusin/focusout events
@@ -1474,7 +1476,9 @@ export class InputHandler extends Disposable implements IInputHandler {
if (this._terminal.element) {
this._terminal.element.classList.remove('enable-mouse-events');
}
this._terminal.selectionManager.enable();
if (this._terminal.selectionManager) {
this._terminal.selectionManager.enable();
}
break;
case 1004: // send focusin/focusout events
this._terminal.sendFocus = false;
+5
View File
@@ -738,6 +738,11 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
this.mouseHelper = new MouseHelper(this.renderer);
// apply mouse event classes set by escape codes before terminal was attached
this.element.classList.toggle('enable-mouse-events', this.mouseEvents);
if (this.mouseEvents) {
this.selectionManager.disable()
} else {
this.selectionManager.enable()
}
if (this.options.screenReaderMode) {
// Note that this must be done *after* the renderer is created in order to