Merge pull request #1927 from pfitzseb/sp/mousehandlerfix

*actually* fix mouse handler before term attached
This commit is contained in:
Daniel Imms
2019-03-04 10:01:42 -08:00
committed by GitHub
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