mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Added resizing event
This commit is contained in:
+11
-7
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user