From 9c2e46a00b0593b06c59a17ce310b81b847ef0a5 Mon Sep 17 00:00:00 2001 From: Matt Kaniaris Date: Mon, 28 Sep 2015 13:46:43 -0700 Subject: [PATCH 1/4] fixes https://github.com/Floobits/atom-term3/issues/1 --- src/term.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/term.js b/src/term.js index 626be53..5e06101 100644 --- a/src/term.js +++ b/src/term.js @@ -2523,12 +2523,6 @@ Terminal.prototype.keyDown = function(ev) { key = '\x1b[6~'; } break; - // CTRL-K - case 75: - if ((!isMac && ev.ctrlKey) || (isMac && ev.metaKey)) { - this.clear(); - return cancel(ev); - } // F1 case 112: key = '\x1bOP'; @@ -2577,6 +2571,13 @@ Terminal.prototype.keyDown = function(ev) { case 123: key = '\x1b[24~'; break; + // CTRL-K + case 75: + if ((!this.isMac && ev.ctrlKey) || (this.isMac && ev.metaKey)) { + this.clear(); + return cancel(ev); + } + // Falls through so that the letter K is handled as expected default: // a-z and space if (ev.ctrlKey) { From 71ac5b97a71bd0c253db96456ff91a77f210fbcc Mon Sep 17 00:00:00 2001 From: Matt Kaniaris Date: Mon, 5 Oct 2015 18:47:03 -0700 Subject: [PATCH 2/4] fix illegal invocation error for messing with native events --- src/term.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/term.js b/src/term.js index 5e06101..71b89cc 100644 --- a/src/term.js +++ b/src/term.js @@ -1081,7 +1081,14 @@ Terminal.prototype.bindMouse = function() { // fix for odd bug //if (self.vt200Mouse && !self.normalMouse) { if (self.vt200Mouse) { - sendButton({ __proto__: ev, type: 'mouseup' }); + var syntheticEvent = {}; + + for (var key in event) { + syntheticEvent[key] = event[key] + } + + syntheticEvent.type = 'mouseup'; + sendButton(syntheticEvent); return cancel(ev); } From 0d1fa6705822ccc6689c4893a8e1c27793d8b9a6 Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Thu, 12 Nov 2015 17:39:25 -0800 Subject: [PATCH 3/4] Unbind data handlers. Fixes a bug where terminal resets could cause multiple onkey handlers to be bound. --- src/term.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/term.js b/src/term.js index 71b89cc..b5ed40c 100644 --- a/src/term.js +++ b/src/term.js @@ -184,6 +184,7 @@ function Terminal(options) { this.rows = options.rows || options.geometry[1]; if (options.handler) { + this.off('data', options.handler); this.on('data', options.handler); } From 4bd056eca0d03e5420472df91923e3e4bb0aaeed Mon Sep 17 00:00:00 2001 From: Jeremy Ebneyamin Date: Tue, 6 Oct 2015 00:18:22 -0700 Subject: [PATCH 4/4] Cherry pick 5d74aa1dc5a57303d48396b6ad3a6a6bdac5b842 from https://github.com/jeremyramin/term.js. Fixes issues with zsh scrolling by not returning early from scroll handler when applicationKeypadMode is enabled. --- src/term.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/term.js b/src/term.js index b5ed40c..de41a87 100644 --- a/src/term.js +++ b/src/term.js @@ -1126,7 +1126,6 @@ Terminal.prototype.bindMouse = function() { // the shell for example on(el, wheelEvent, function(ev) { if (self.mouseEvents) return; - if (self.applicationKeypad) return; if (ev.type === 'DOMMouseScroll') { self.scrollDisp(ev.detail < 0 ? -5 : 5); } else {