From ff18b193eb2cf8615488d503b4ef148c69f64e7b Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 25 Jun 2018 11:27:57 -0700 Subject: [PATCH 1/4] Pin node-pty to 0.7.6 --- package.json | 2 +- src/Terminal.integration.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4aaac342..2887d56a 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "jsdoc": "3.4.3", "jsdom": "^11.11.0", "merge-stream": "^1.0.1", - "node-pty": "^0.7.2", + "node-pty": "0.7.6", "nodemon": "1.10.2", "npm-run-all": "^4.1.2", "nyc": "^11.8.0", diff --git a/src/Terminal.integration.ts b/src/Terminal.integration.ts index 7b7cdbdd..f37d7840 100644 --- a/src/Terminal.integration.ts +++ b/src/Terminal.integration.ts @@ -88,7 +88,7 @@ if (os.platform() !== 'win32') { /** some helpers for pty interaction */ // we need a pty in between to get the termios decorations // for the basic test cases a raw pty device is enough - primitivePty = pty.native.open(cols, rows); + primitivePty = (pty).native.open(cols, rows); /** tests */ describe('xterm output comparison', () => { From f1504e5c0fd8297a9f5e3773ee6b87444fb45c2b Mon Sep 17 00:00:00 2001 From: 7PH Date: Tue, 26 Jun 2018 10:33:46 +0200 Subject: [PATCH 2/4] #1532: Terminal reset does not affect cursorState anymore --- src/Terminal.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Terminal.ts b/src/Terminal.ts index 4d062f76..9f581461 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -1830,9 +1830,11 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II this.options.cols = this.cols; const customKeyEventHandler = this._customKeyEventHandler; const inputHandler = this._inputHandler; + const cursorState = this.cursorState; this._setup(); this._customKeyEventHandler = customKeyEventHandler; this._inputHandler = inputHandler; + this.cursorState = cursorState; this.refresh(0, this.rows - 1); if (this.viewport) { this.viewport.syncScrollArea(); From 0ad7b8e27b2da454991ad6fd0d5a3c27c870f67e Mon Sep 17 00:00:00 2001 From: 7PH Date: Tue, 26 Jun 2018 10:36:11 +0200 Subject: [PATCH 3/4] #1532: Add test to ensure terminal reset does not affect cursorState --- src/Terminal.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Terminal.test.ts b/src/Terminal.test.ts index 0745ddda..28ce6ce8 100644 --- a/src/Terminal.test.ts +++ b/src/Terminal.test.ts @@ -120,6 +120,14 @@ describe('term.js addons', () => { }); }); + describe('reset', () => { + it('should not affect cursorState', () => { + term.cursorState = 1; + term.reset(); + assert.equal(term.cursorState, 1); + }); + }); + describe('clear', () => { it('should clear a buffer equal to rows', () => { const promptLine = term.buffer.lines.get(term.buffer.ybase + term.buffer.y); From 218a4014c78b64ec6b681ca1964e0235c86e67c2 Mon Sep 17 00:00:00 2001 From: 7PH Date: Tue, 26 Jun 2018 10:42:08 +0200 Subject: [PATCH 4/4] #1532: Add test to ensure terminal reset does not display cursor if hidden before --- src/Terminal.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Terminal.test.ts b/src/Terminal.test.ts index 28ce6ce8..0ea854e2 100644 --- a/src/Terminal.test.ts +++ b/src/Terminal.test.ts @@ -125,6 +125,9 @@ describe('term.js addons', () => { term.cursorState = 1; term.reset(); assert.equal(term.cursorState, 1); + term.cursorState = 0; + term.reset(); + assert.equal(term.cursorState, 0); }); });