Merge pull request #228 from ayapi/restore-customkeydownhandler

restore customKeydownHandler on reset(RIS)
This commit is contained in:
Paris Kasidiaris
2016-08-16 17:20:40 +03:00
committed by GitHub
2 changed files with 11 additions and 0 deletions
+2
View File
@@ -3467,7 +3467,9 @@
Terminal.prototype.reset = function() {
this.options.rows = this.rows;
this.options.cols = this.cols;
var customKeydownHandler = this.customKeydownHandler;
Terminal.call(this, this.options);
this.customKeydownHandler = customKeydownHandler;
this.refresh(0, this.rows - 1);
};
+9
View File
@@ -88,6 +88,15 @@ describe('xterm.js', function() {
});
assert.equal(xterm.keyDown(Object.assign({}, evKeyDown, { keyCode: 77 })), false);
});
it('should alive after reset(ESC c Full Reset (RIS))', function () {
xterm.attachCustomKeydownHandler(function (ev) {
return ev.keyCode !== 77;
});
assert.equal(xterm.keyDown(Object.assign({}, evKeyDown, { keyCode: 77 })), false);
xterm.reset();
assert.equal(xterm.keyDown(Object.assign({}, evKeyDown, { keyCode: 77 })), false);
});
});
describe('evaluateCopiedTextProcessing', function () {