From 605d61b64fac86c0172f32ea1132eb16cfa44c20 Mon Sep 17 00:00:00 2001 From: Paris Kasidiaris Date: Sun, 23 Oct 2016 13:28:08 +0300 Subject: [PATCH 1/3] Ignore `.env` files that set the environment --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2fb4e7e..2e91366 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ example/*.log docs/ npm-debug.log /.idea/ +.env From a9417c68780b1ebf4a8883a204c7bada43c1857b Mon Sep 17 00:00:00 2001 From: Paris Kasidiaris Date: Sun, 23 Oct 2016 14:13:20 +0300 Subject: [PATCH 2/3] Fix `term.geometry` and document it in constructor options Set `term.geometry` on terminal creation and on resize --- src/xterm.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xterm.js b/src/xterm.js index abf9618..18470e5 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -63,7 +63,10 @@ var normal = 0, escaped = 1, csi = 2, osc = 3, charset = 4, dcs = 5, ignore = 6; * Creates a new `Terminal` object. * * @param {object} options An object containing a set of options, the available options are: - * - cursorBlink (boolean): Whether the terminal cursor blinks + * - `cursorBlink` (boolean): Whether the terminal cursor blinks + * - `cols` (number): The number of columns of the terminal (horizontal size) + * - `rows` (number): The number of rows of the terminal (vertical size) + * - `geometry` (array): Shortcut for terminal size: `[cols, rows]` (lower priority) * * @public * @class Xterm Xterm @@ -125,6 +128,7 @@ function Terminal(options) { this.cols = options.cols || options.geometry[0]; this.rows = options.rows || options.geometry[1]; + this.geometry = [this.cols, this.rows]; if (options.handler) { this.on('data', options.handler); @@ -2942,6 +2946,7 @@ Terminal.prototype.resize = function(x, y) { this.normal = null; + this.geometry = [this.cols, this.rows]; this.emit('resize', {terminal: this, cols: x, rows: y}); }; From e8e7870be2895a270d3218280dc1b3bc6b690067 Mon Sep 17 00:00:00 2001 From: Paris Kasidiaris Date: Sun, 23 Oct 2016 17:55:37 +0300 Subject: [PATCH 3/3] Remove `geometry` option from terminal consttructor --- src/xterm.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/xterm.js b/src/xterm.js index 18470e5..ac57068 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -66,7 +66,6 @@ var normal = 0, escaped = 1, csi = 2, osc = 3, charset = 4, dcs = 5, ignore = 6; * - `cursorBlink` (boolean): Whether the terminal cursor blinks * - `cols` (number): The number of columns of the terminal (horizontal size) * - `rows` (number): The number of rows of the terminal (vertical size) - * - `geometry` (array): Shortcut for terminal size: `[cols, rows]` (lower priority) * * @public * @class Xterm Xterm