/usr/bin/tty will output the current tty e.g. /dev/ttys006 - this can be used instead,
but spawning /usr/bin/tty has to be done async on node 0.10 - which means there
would be an async setup step.
$ node --version
v0.10.40
$ node -e "require('prompt-sync').prompt()"
fs.js:488
var r = binding.read(fd, buffer, offset, length, position);
^
Error: EAGAIN, resource temporarily unavailable
at Object.fs.readSync (fs.js:488:19)
at Object.prompt (/Users/davidclements/z/nearForm/fuge/fuge/node_modules/prompt-sync/index.js:54:15)
at [eval]:1:24
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (module.js:456:26)
at evalScript (node.js:565:25)
at startup (node.js:80:7)
at node.js:935:3
this is due to reading from /dev/stdin
/usr/bin/tty will output the current tty e.g.
/dev/ttys006
- this can be used instead, but spawning/usr/bin/tty
has to be done async on node 0.10 - which means there would be an async setup step.