This repository has been archived by the owner. It is now read-only.

Referencing stdin breaks other usage of stdin outside of node #8083

Closed
boushley opened this Issue Aug 6, 2014 · 6 comments

Comments

Projects
None yet
3 participants
@boushley

boushley commented Aug 6, 2014

If you reference process.stdin; within a node script all usage of stdin in other tools is broken. And give output similar to read: read error: 0: Resource temporarily unavailable

The simplest repro of this that I could come up with was this:

read -p "Works? (y/N) " yn && node -e "process.stdin;" && read -p "Works? (y/N) " yn

but other usages of stdin also cause problems...

read -p "Works? (y/N) " yn && node -e "process.stdin.resume(); process.stdin.pause();" && read -p "Works? (y/N) " yn

Normal usage of node doesn't cause this problem:

read -p "Works? (y/N) " yn && node -e "console.log('hi');" && read -p "Works? (y/N) " yn

This causes problems when using node.js in combination with other command line tools. Are there any known or possible workarounds?

@boushley

This comment has been minimized.

boushley commented Aug 6, 2014

This is reproducing for me in node "v0.10.30" and a number of earlier versions on both Mac OSX and Ubuntu.

@vkurchatkin

This comment has been minimized.

Member

vkurchatkin commented Aug 6, 2014

works in 0.11.13

@boushley

This comment has been minimized.

boushley commented Aug 6, 2014

Is there a 0.11 version that is close to reaching stable?

@trevnorris

This comment has been minimized.

trevnorris commented Aug 13, 2014

We've cut the v0.12 branch, if that means anything ;)

@trevnorris

This comment has been minimized.

trevnorris commented Aug 13, 2014

@boushley this still an issue?

@boushley

This comment has been minimized.

boushley commented Aug 13, 2014

@trevnorris Nope, looks like this does appear to be resolve in 0.11.13.

@trevnorris trevnorris closed this Aug 18, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.