From 833385b0e07c5d88ad3ed928d8c64268d3726898 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Fri, 24 Jan 2020 06:31:35 -0300 Subject: [PATCH] Workaround node.js bug with readline (#882) --- packages/inquirer/lib/ui/baseUI.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/inquirer/lib/ui/baseUI.js b/packages/inquirer/lib/ui/baseUI.js index 0567d7c40..0903e9af5 100644 --- a/packages/inquirer/lib/ui/baseUI.js +++ b/packages/inquirer/lib/ui/baseUI.js @@ -55,7 +55,11 @@ class UI { // Close the readline this.rl.output.end(); this.rl.pause(); - this.rl.close(); + + // @see https://github.com/nodejs/node/issues/21771 + if (!/^win/i.test(process.platform)) { + this.rl.close(); + } } }