Closed hugobuddel closed 8 months ago
I'm currently developing on GUIX (a GNU Linux distribution), which is a bit unusual distribution, so it could be a problem on my end. Should those commands above work?
Seems that there can be similar problems on windows: https://stackoverflow.com/questions/45890339/stdout-is-not-a-tty-using-bash-for-node-tape-tap-spec (but the suggestions there did not seem to result in anything to resolve my problem).
No, it's not a GUIX thing, it's to do with how nodeJS handles synchronous IO. Verified as a bug, although fixing it might be entertaining (yay nodeJS)... let me take a look, see if we can wrap the readlineSync
stuff in a regular readline
so if there's stuff already available on stdin
it won't block.
Rockstar 2.0 will not be built on nodeJS so won't have these kinds of headaches with async IO.
How can stdin be read from file or pipe in Satriani?
I have these two files:
Now I want the parrot to say hello, but neither these work:
Both those commands still ask for input, and while I can manually paste the contents of hello.txt into the terminal, the goal is to automate that.
I'm currently developing on rocky, where both these constructs work. However, I'm trying to resolve some inconsistencies between Satriani and rocky, and copy pasting the code into the online editor is now the bottleneck, so I'm hoping to get the command-line working.
Maybe this is standard node behavior? This is the first time for me running node command line programs. Is there some flag I need to specify?