Closed Jpunt closed 8 years ago
Same here.
Our Command executes git flow feature start "feature_name"
and gets stuck although everything is done correctly.
Any fix?
@Jpunt After a quick test i suggest you to use grunt-exec in the meantime until this is fixed. It works for us and the commands are the same.
Also had a command getting stuck: ncu -u
which is npm-check-updates.
Nevermind me, my issue seems with the module itself - https://github.com/tjunnone/npm-check-updates/issues/119
Nope, it's a grunt-shell issue. Also npm install
breaks. This could be the reason: https://github.com/tjunnone/npm-check-updates/issues/119
I think the issue with ncu
boils down to process.stdin.isTTY being undefined
in processes spawned by exec
, making is-stdin
think there i something on stdin when there is not. grunt-shell
's attempt to pipe stdin (process.stdin.pipe(cp.stdin)
) to the child is fruitless because the exec command already has run by the point this pipe is attached.
I think the proper solution here would be to switch to spawn
and define stdio stream handling inside the spawn
options. Either that, or it's a node bug with isTTY
(though undefined
vs false
doesn't change much for this bug).
Closing as it seems it's a Node.js core problem and nothing we can do here.
I think this should be fixed in this module or maybe a wrapper by calling stdin.end()
on the ChildProcess. Any child process that waits on stdin will hang until stdin is explicitely closed:
https://nodejs.org/api/child_process.html#child_process_child_stdin
My shell gets stuck when running this command, but only sometimes:
new_version
comes from task from grunt-prompt. The weird thing is, the commands are actually executed (i've got a new commit with that message, a new tag, and everything is pushed), but my shell doesn't get the callback:What can I try to fix this?