From 6ea891a159c5e7b860cc12ef7d15c6f1e156095e Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 14 Aug 2013 17:30:05 -0500 Subject: [PATCH] listen for paste event on window. --- src/term.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/term.js b/src/term.js index 971da7df..ff235aa3 100644 --- a/src/term.js +++ b/src/term.js @@ -675,7 +675,9 @@ Terminal.prototype.open = function(parent) { // This seems to work well for ctrl-V and middle-click, // even without the contentEditable workaround. - on(this.element, 'paste', function(ev) { + // TODO Move this to initGlobal. + on(this.context, 'paste', function(ev) { + if (Terminal.focus !== self) return; if (ev.clipboardData) { self.send(ev.clipboardData.getData('text/plain')); } else if (self.context.clipboardData) {