From 1cc0d43aa41025bf2f1b46eedad58034a40da004 Mon Sep 17 00:00:00 2001 From: mofux Date: Fri, 14 Jul 2017 14:00:55 +0200 Subject: [PATCH 1/2] Clear selection on input --- src/xterm.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xterm.js b/src/xterm.js index d625a3cf..16c88a91 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -2234,6 +2234,11 @@ Terminal.prototype.handler = function(data) { return; } + // Clear the selection + if (this.hasSelection()) { + this.clearSelection(); + } + // Input is being sent to the terminal, the terminal should focus the prompt. if (this.ybase !== this.ydisp) { this.scrollToBottom(); From 1b6ce6dab640bd8ecefff9a5fbafd7fa79d9ac57 Mon Sep 17 00:00:00 2001 From: mofux Date: Fri, 14 Jul 2017 15:18:12 +0200 Subject: [PATCH 2/2] Make sure selection manager is available (only after open() was called) --- src/xterm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xterm.js b/src/xterm.js index 16c88a91..c18277e7 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -2234,9 +2234,9 @@ Terminal.prototype.handler = function(data) { return; } - // Clear the selection - if (this.hasSelection()) { - this.clearSelection(); + // Clear the selection if the selection manager is available and has an active selection + if (this.selectionManager && this.selectionManager.hasSelection) { + this.selectionManager.clearSelection(); } // Input is being sent to the terminal, the terminal should focus the prompt.