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

fix hangs with CLI commands waiting for input #115

Closed
wants to merge 2 commits into from

Conversation

silverwind
Copy link

The previous .resume() and .pipe() did not close the stdin stream on the child process which made scripts that wait for data on stdin hang. The fix manually sends all stdin chunks to the child and ensures that the stream is always closed afterwards.

There might be a cleaner solution using flowing mode, but I'm not sure how to ensure closure of the target WriteStream when using .pipe().

This should properly solve these issue:

The previous .resume() and .pipe() did not close the stdin stream on the
child process which made scripts that wait for data on stdin hang. The
fix manually sends all stdin chunks to the child and ensures that the
stream is always closed afterwards.
@silverwind
Copy link
Author

Actually, there seems to be an issue when sending big amounts of data on stdin, investigating.

@silverwind
Copy link
Author

I have to rethink this. I'm pretty certain the issue could be fixed on get-stdin's side too, but hopefully not with a timeout like in sindresorhus/get-stdin#19.

@silverwind silverwind closed this Feb 14, 2017
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

Successfully merging this pull request may close these issues.

1 participant