Ensure outside selection pastes are respected

We were resetting the selection on every auxclick, meaning outside
selections could not be pasted in when the terminal had a current
selection.
This commit is contained in:
Daniel Imms
2017-06-20 11:17:12 -07:00
parent ef1e2ab9e2
commit 63d63c27e7
3 changed files with 25 additions and 13 deletions
+4 -2
View File
@@ -293,8 +293,10 @@ export class SelectionManager extends EventEmitter {
/**
* Queues a refresh, redrawing the selection on the next opportunity.
* @param isNewSelection Whether the selection should be registered as a new
* selection on Linux.
*/
public refresh(fromMouseEvent?: boolean): void {
public refresh(isNewSelection?: boolean): void {
// Queue the refresh for the renderer
if (!this._refreshAnimationFrame) {
this._refreshAnimationFrame = window.requestAnimationFrame(() => this._refresh());
@@ -302,7 +304,7 @@ export class SelectionManager extends EventEmitter {
// If the platform is Linux and the refresh call comes from a mouse event,
// we need to update the selection for middle click to paste selection.
if (Browser.isLinux && fromMouseEvent) {
if (Browser.isLinux && isNewSelection) {
const selectionText = this.selectionText;
if (selectionText.length) {
this.emit('newselection', this.selectionText);