From 996c25a3648a899a8bb05ad5bc9df3a0b4629868 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 7 Jan 2017 16:04:46 -0800 Subject: [PATCH] Keep previous terminal events after a reset This broke in the EventEmitter ts conversion, just reverts this line to what it used to be. Fixes #451 --- src/EventEmitter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/EventEmitter.ts b/src/EventEmitter.ts index d05e3863..1db86763 100644 --- a/src/EventEmitter.ts +++ b/src/EventEmitter.ts @@ -11,7 +11,9 @@ export class EventEmitter { private _events: {[type: string]: ListenerType[]}; constructor() { - this._events = {}; + // Restore the previous events if available, this will happen if the + // constructor is called multiple times on the same object (terminal reset). + this._events = this._events || {}; } public on(type, listener): void {