Open guypursey opened 4 years ago
This might have something to do with the reliance on process.stdin
... code suggests that's being used when process.platform === 'win32'
. From the little I know, if a TTY readstream can be used instead, for example, it means piped input and keyboard input can be accepted and should work.
To recreate, create the following file
prompt-test.js
, as a very simple test:If run as
./prompt-test.js
, it will ask for an input 5 times and print that output as you might expect.However if you trying running
echo hello world | ./prompt-test.js
, the prompt itself is caught in a loop and repeats the prompt line and all previous inputs continually.This might be happening because of my lack of understanding about Bash processes, sub-processes, or piping. Any help appreciated.