Fix: stream mode conflict

This commit is contained in:
anseki 2015-04-26 16:05:54 +09:00
parent 64e65b27d3
commit 56e1a7d3d1
2 changed files with 3 additions and 1 deletions

View file

@ -85,6 +85,7 @@ function _readlineSync(options) {
if (IS_WIN) { if (IS_WIN) {
if (process.stdin.isTTY) { if (process.stdin.isTTY) {
process.stdin.pause();
fdR = process.stdin.fd; fdR = process.stdin.fd;
ttyR = process.stdin._handle; ttyR = process.stdin._handle;
} else { } else {
@ -111,6 +112,7 @@ function _readlineSync(options) {
} else { } else {
if (process.stdin.isTTY) { if (process.stdin.isTTY) {
process.stdin.pause();
try { try {
fdR = fs.openSync('/dev/tty', 'r'); // device file, not process.stdin fdR = fs.openSync('/dev/tty', 'r'); // device file, not process.stdin
ttyR = process.stdin._handle; ttyR = process.stdin._handle;

View file

@ -1,6 +1,6 @@
{ {
"name": "readline-sync", "name": "readline-sync",
"version": "1.2.13", "version": "1.2.14",
"title": "readlineSync", "title": "readlineSync",
"description": "Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).", "description": "Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).",
"keywords": [ "keywords": [