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.