it('should return \\x1b[5C for ctrl+right', function() {
assert.equal(xterm.evaluateKeyEscapeSequence({ ctrlKey: true, keyCode: 39 }).key, '\x1b[1;5C'); // CSI 5 C
});
+ it('should return \\x1b[5A for ctrl+up', function() {
+ assert.equal(xterm.evaluateKeyEscapeSequence({ ctrlKey: true, keyCode: 38 }).key, '\x1b[1;5A'); // CSI 5 A
+ });
+ it('should return \\x1b[5B for ctrl+down', function() {
+ assert.equal(xterm.evaluateKeyEscapeSequence({ ctrlKey: true, keyCode: 40 }).key, '\x1b[1;5B'); // CSI 5 B
+ });
+ // Evalueate alt + arrow key movement, which is a feature of terminal emulators but not VT100
+ // http://unix.stackexchange.com/a/108106
+ it('should return \\x1b[5D for alt+left', function() {
+ assert.equal(xterm.evaluateKeyEscapeSequence({ altKey: true, keyCode: 37 }).key, '\x1b[1;5D'); // CSI 5 D
+ });
+ it('should return \\x1b[5C for alt+right', function() {
+ assert.equal(xterm.evaluateKeyEscapeSequence({ altKey: true, keyCode: 39 }).key, '\x1b[1;5C'); // CSI 5 C
+ });
+ it('should return \\x1b[5A for alt+up', function() {
+ assert.equal(xterm.evaluateKeyEscapeSequence({ altKey: true, keyCode: 38 }).key, '\x1b[1;5A'); // CSI 5 A
+ });
+ it('should return \\x1b[5B for alt+down', function() {
+ assert.equal(xterm.evaluateKeyEscapeSequence({ altKey: true, keyCode: 40 }).key, '\x1b[1;5B'); // CSI 5 B
+ });
});
describe('attachCustomEventHandler', 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;