Skip to content

child_process: async spawn methods not closing stdin #2339

Closed
@silverwind

Description

@silverwind

Currently, there is no way to distinguish if the process is being piped/redirected to or if it is spawned by child_process.exec. The following examples both yield the exact same process.stdin object, leaving a script undecided whether it should wait for input on stdin if it choses to accept data on stdin:

Attached stdin

echo "something" | iojs -p process.stdin

Spawned by exec

iojs -p "require('child_process').exec('iojs -p process.stdin', function(err,stdout) { process.stdout.write(stdout); })"

If it is possible to distinguish these cases, I'd like to see a new property on process.stdin that returns true when the process has its stdin attached, false if it is not.

related: raineorshine/npm-check-updates#119
cc: @metaraine

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions