diff --git a/packages/inquirerer/src/keypress.ts b/packages/inquirerer/src/keypress.ts index 010646e..b715db1 100644 --- a/packages/inquirerer/src/keypress.ts +++ b/packages/inquirerer/src/keypress.ts @@ -150,6 +150,9 @@ export class TerminalKeypress { pause(): void { this.active = false; this.clearHandlers(); + if (typeof (this.input as any).setRawMode === 'function') { + (this.input as any).setRawMode(false); + } } resume(): void { diff --git a/packages/inquirerer/src/prompt.ts b/packages/inquirerer/src/prompt.ts index 7962533..0cb1a60 100644 --- a/packages/inquirerer/src/prompt.ts +++ b/packages/inquirerer/src/prompt.ts @@ -1329,7 +1329,11 @@ export class Inquirerer { public close() { if (this.rl) { this.rl.close(); + this.rl = null; + } + if (this.keypress) { this.keypress.destroy(); + this.keypress = null; } } }