Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subsequent prompts after first do not print when specifying optional stdout stream #109

Open
limulus opened this issue Feb 23, 2015 · 1 comment

Comments

@limulus
Copy link

limulus commented Feb 23, 2015

TL;DR: It’s because of a bug in a dependency: isaacs/read#23, npm/mute-stream#5

When using the stdout option to prompt.start(), the specified WriteStream instance winds up getting closed after the first prompt, and all subsequent prompts do not get printed. The following code reproduces this issue:

var prompt = require("prompt")
var tty = require("tty")
var fs = require("fs")

var ttyFD = fs.openSync("/dev/tty", "r+")
var ttyWS = new tty.WriteStream(ttyFD)

prompt.start({ stdout: ttyWS })
prompt.get(["1st", "2nd"], function (err, result) {
  console.log(result)
})

The fix for this is probably just to wait for it to be fixed in mute-stream and read, but for now hopefully this report saves someone some frustration.

@gangstead
Copy link
Member


Someone needs to harry @isaacs to accept that PR and republish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants