From aaf099119510b5cc5eb117ae49df501fa04496a2 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 19 Dec 2017 13:25:26 -0800 Subject: [PATCH] Make lineFeed event lowercase Fixes #1159 --- fixtures/typings-test/typings-test.ts | 4 ++-- src/InputHandler.ts | 4 ++-- src/addons/winptyCompat/winptyCompat.ts | 2 +- typings/xterm.d.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fixtures/typings-test/typings-test.ts b/fixtures/typings-test/typings-test.ts index 887eb322..9166aa17 100644 --- a/fixtures/typings-test/typings-test.ts +++ b/fixtures/typings-test/typings-test.ts @@ -63,7 +63,7 @@ namespace methods_core { // no arg t.on('blur', () => {}); t.on('focus', () => {}); - t.on('lineFeed', () => {}); + t.on('linefeed', () => {}); t.on('selection', () => {}); // args t.on('data', () => {}); @@ -89,7 +89,7 @@ namespace methods_core { // no arg t.off('blur', () => {}); t.off('focus', () => {}); - t.off('lineFeed', () => {}); + t.off('linefeed', () => {}); t.off('selection', () => {}); // args t.off('data', () => {}); diff --git a/src/InputHandler.ts b/src/InputHandler.ts index 512cf878..1ba6dc7a 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -134,9 +134,9 @@ export class InputHandler implements IInputHandler { /** * This event is emitted whenever the terminal outputs a LF or NL. * - * @event lineFeed + * @event linefeed */ - this._terminal.emit('lineFeed'); + this._terminal.emit('linefeed'); } /** diff --git a/src/addons/winptyCompat/winptyCompat.ts b/src/addons/winptyCompat/winptyCompat.ts index 7474df2e..4454f0bb 100644 --- a/src/addons/winptyCompat/winptyCompat.ts +++ b/src/addons/winptyCompat/winptyCompat.ts @@ -41,7 +41,7 @@ declare var define: any; // space. This is certainly not without its problems, but generally on // Windows when text reaches the end of the terminal it's likely going to be // wrapped. - this.on('lineFeed', () => { + this.on('linefeed', () => { const line = this.buffer.lines.get(this.buffer.ybase + this.buffer.y - 1); const lastChar = line[this.cols - 1]; if (lastChar[3] !== 32 /* ' ' */) { diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 43be69c2..86d1ea58 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -218,7 +218,7 @@ declare module 'xterm' { * @param type The type of the event. * @param listener The listener. */ - on(type: 'blur' | 'focus' | 'lineFeed' | 'selection', listener: () => void): void; + on(type: 'blur' | 'focus' | 'linefeed' | 'selection', listener: () => void): void; /** * Registers an event listener. * @param type The type of the event. @@ -273,7 +273,7 @@ declare module 'xterm' { * @param type The type of the event. * @param listener The listener. */ - off(type: 'blur' | 'focus' | 'lineFeed' | 'selection' | 'data' | 'key' | 'keypress' | 'keydown' | 'refresh' | 'resize' | 'scroll' | 'title' | string, listener: (...args: any[]) => void): void; + off(type: 'blur' | 'focus' | 'linefeed' | 'selection' | 'data' | 'key' | 'keypress' | 'keydown' | 'refresh' | 'resize' | 'scroll' | 'title' | string, listener: (...args: any[]) => void): void; /** * Resizes the terminal.