Inquirer.js icon indicating copy to clipboard operation
Inquirer.js copied to clipboard

Arrows are not working in cmd?

Open ouahibAbdou opened this issue 6 years ago • 8 comments
trafficstars

ouahibAbdou avatar Aug 29 '19 17:08 ouahibAbdou

This is happening for me as well. (in my case powershell)

ResourceHog avatar Aug 30 '19 03:08 ResourceHog

@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.

SBoudrias avatar Aug 30 '19 05:08 SBoudrias

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

ResourceHog avatar Aug 30 '19 11:08 ResourceHog

Nodemon has this problem. Use node instead of nodemon.

wztscau avatar Jan 07 '20 03:01 wztscau

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

accimeesterlin avatar May 18 '20 19:05 accimeesterlin

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.

dhl avatar Sep 30 '20 17:09 dhl

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

adivated avatar Oct 04 '20 09:10 adivated

For anyone looking for the nodemon configuration : { stdin : false } in the configuration file or --no-stdin flag

gouroujo avatar Dec 01 '20 16:12 gouroujo