From 56e1a7d3d10590df98e654db67d363e50a1d60b4 Mon Sep 17 00:00:00 2001 From: anseki Date: Sun, 26 Apr 2015 16:05:54 +0900 Subject: [PATCH] Fix: stream mode conflict --- lib/readline-sync.js | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/readline-sync.js b/lib/readline-sync.js index f6e5a0f..505875b 100644 --- a/lib/readline-sync.js +++ b/lib/readline-sync.js @@ -85,6 +85,7 @@ function _readlineSync(options) { if (IS_WIN) { if (process.stdin.isTTY) { + process.stdin.pause(); fdR = process.stdin.fd; ttyR = process.stdin._handle; } else { @@ -111,6 +112,7 @@ function _readlineSync(options) { } else { if (process.stdin.isTTY) { + process.stdin.pause(); try { fdR = fs.openSync('/dev/tty', 'r'); // device file, not process.stdin ttyR = process.stdin._handle; diff --git a/package.json b/package.json index f618243..c3aa9df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "readline-sync", - "version": "1.2.13", + "version": "1.2.14", "title": "readlineSync", "description": "Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).", "keywords": [