From c719316327a9810191579f96a683bfb5de99d2b6 Mon Sep 17 00:00:00 2001 From: anseki Date: Sat, 4 Jun 2016 21:18:42 +0900 Subject: [PATCH] Fixes #37 Node.js bug (#18) regressed again in v5.6.0, it is fixed in v6.2.0. --- lib/readline-sync.js | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/readline-sync.js b/lib/readline-sync.js index 455ee22..48b3007 100644 --- a/lib/readline-sync.js +++ b/lib/readline-sync.js @@ -270,8 +270,9 @@ function _readlineSync(options) { if (IS_WIN) { // iojs-v2.3.2+ input stream can't read first line. (#18) // ** Don't get process.stdin before check! ** - // Fixed v5.1.0 https://nodejs.org/en/blog/release/v5.1.0/ - // Fixed v4.2.4 (LTS) https://nodejs.org/en/blog/release/v4.2.4/ + // Fixed v5.1.0 + // Fixed v4.2.4 + // It regressed again in v5.6.0, it is fixed in v6.2.0. verNum = (function(ver) { // getVerNum var nums = ver.replace(/^\D+/, '').split('.'); var verNum = 0; @@ -280,7 +281,7 @@ function _readlineSync(options) { if ((nums[2] = +nums[2])) { verNum += nums[2]; } return verNum; })(process.version); - if (!(verNum >= 20302 && verNum < 40204 || verNum >= 50000 && verNum < 50100) && + if (!(verNum >= 20302 && verNum < 40204 || verNum >= 50000 && verNum < 50100 || verNum >= 50600 && verNum < 60200) && process.stdin.isTTY) { process.stdin.pause(); fdR = process.stdin.fd; diff --git a/package.json b/package.json index 8c41c13..d5ac939 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "readline-sync", - "version": "1.4.2", + "version": "1.4.3", "title": "readlineSync", "description": "Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).", "keywords": [