Fix issue with resetting terminal.

Ensure new BufferSet is used and clear selection manager on reset.
This commit is contained in:
Andres Mejia
2018-01-18 17:48:29 -05:00
parent cfd00529eb
commit 5133f25fb7
2 changed files with 8 additions and 2 deletions
+4
View File
@@ -121,6 +121,10 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
this._mouseUpListener = event => this._onMouseUp(<MouseEvent>event);
this._trimListener = (amount: number) => this._onTrim(amount);
this.initBuffersListeners();
}
public initBuffersListeners(): void {
this._terminal.buffer.lines.on('trim', this._trimListener);
this._terminal.buffers.on('activate', e => this._onBufferActivate(e));
}
+4 -2
View File
@@ -292,6 +292,10 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
// Create the terminal's buffers and set the current buffer
this.buffers = new BufferSet(this);
if (this.selectionManager) {
this.selectionManager.clearSelection();
this.selectionManager.initBuffersListeners();
}
}
/**
@@ -2076,11 +2080,9 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
this.options.cols = this.cols;
const customKeyEventHandler = this.customKeyEventHandler;
const inputHandler = this.inputHandler;
const buffers = this.buffers;
this.setup();
this.customKeyEventHandler = customKeyEventHandler;
this.inputHandler = inputHandler;
this.buffers = buffers;
this.refresh(0, this.rows - 1);
this.viewport.syncScrollArea();
}