From 72724abac8db61f7577c243d4c73791a1581aef8 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 7 Jun 2017 11:20:03 -0700 Subject: [PATCH] Ensure host program handles copy if mouseevents are active --- src/xterm.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xterm.js b/src/xterm.js index 1ba3facf..5b3237e9 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -526,7 +526,12 @@ Terminal.prototype.initGlobal = function() { // Bind clipboard functionality on(this.element, 'copy', event => { - copyHandler(event, term, term.selectionManager); + // If mouse events are active it means the selection manager is disabled and + // copy should be handled by the host program. + if (this.mouseEvents) { + return; + } + copyHandler(event, term, this.selectionManager); }); const pasteHandlerWrapper = event => pasteHandler(event, term); on(this.textarea, 'paste', pasteHandlerWrapper);