From 725e9423be4df30d863d4f3fdfd912bf86dee0af Mon Sep 17 00:00:00 2001 From: paris Date: Tue, 25 Mar 2014 17:49:07 +0000 Subject: [PATCH] Added resizing event --- src/xterm.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/xterm.js b/src/xterm.js index 8e26f8cdb..88b85020c 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -2694,21 +2694,25 @@ Terminal.prototype.resize = function(x, y) { } this.rows = y; - // make sure the cursor stays on screen - if (this.y >= y) this.y = y - 1; - if (this.x >= x) this.x = x - 1; + /* + * Make sure that the cursor stays on screen + */ + if (this.y >= y) { + this.y = y - 1; + } + + if (this.x >= x) { + this.x = x - 1; + } this.scrollTop = 0; this.scrollBottom = y - 1; this.refresh(0, this.rows - 1); - // it's a real nightmare trying - // to resize the original - // screen buffer. just set it - // to null for now. this.normal = null; + this.emit('resize', {terminal: this, columns: x, rows: y}); }; Terminal.prototype.updateRange = function(y) {