Support selection

This commit is contained in:
Daniel Imms
2017-08-31 00:09:23 -07:00
parent 5953bbab42
commit 3d1bb2c60f
8 changed files with 59 additions and 49 deletions
+3 -3
View File
@@ -751,10 +751,10 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
this.renderer = new Renderer(this);
this.on('resize', () => this.renderer.onResize(this.cols, this.rows));
this.charMeasure.on('charsizechanged', () => this.renderer.onCharSizeChanged(this.charMeasure.width, this.charMeasure.height));
this.selectionManager = new SelectionManager(this, this.buffer, this.rowContainer, this.charMeasure);
// this.selectionManager.on('refresh', data => {
// this.renderer.refreshSelection(data.start, data.end);
// });
this.element.addEventListener('mousedown', (e: MouseEvent) => this.selectionManager.onMouseDown(e));
this.selectionManager.on('refresh', data => this.renderer.onSelectionChanged(data.start, data.end));
this.selectionManager.on('newselection', text => {
// If there's a new selection, put it into the textarea, focus and select it
// in order to register it as a selection on the OS. This event is fired