Inquirer.js
Inquirer.js copied to clipboard
Arrows are not working in cmd?
This is happening for me as well. (in my case powershell)
@ResourceHog @ouahibAbdou how are you running your app?
node index.js or something else? If it's something else you need to make sure the input events are piped in.
That's exactly how aframe-typescript-toolkit runs.
equivalent script in question: https://github.com/olioapps/aframe-typescript-toolkit/blob/master/cli.js
"npm run cli" is what I use but it's just an alias for "node cli.js"
Package file: https://github.com/olioapps/aframe-typescript-toolkit/blob/master/package.json
Nodemon has this problem. Use node instead of nodemon.
I can confirm that this is not an issue with inquirer itself. It's an issue with nodemon. Run the app using node instead
node index.js
This is definitely a problem I can reproduce with rawlist, even without nodemon involved. list, on the other hand, is fine.
I have two modules:
app.js # entry module, what gets launched with `node app.js`
menu.js # creates a menu with `inquirer`. This is where `inquirer` is loaded.
With this setup, arrow key doesn't work on rawlist. However, if I require inquirer in app.js and pass the module into menu.js and using the passed in module, arrow key would work.
it's actually not a bug in either inquirer or nodemon, pass stdin to nodemon with -I flag. See: https://github.com/remy/nodemon/issues/1445 https://github.com/remy/nodemon/blob/master/doc/cli/options.txt#L16
For anyone looking for the nodemon configuration : { stdin : false } in the configuration file or --no-stdin flag