Inquirer.js: Feature request: break input

Created on 29 Sep 2015  路  6Comments  路  Source: SBoudrias/Inquirer.js

As a user, I would like to be able to break input by pressing esc or ctrl-c to cancel input and return to the previous prompt.

Most helpful comment

I'm not implying breaking the default behavior, but providing means to be able to get out of a menu by pressing some key(s) [escape perhaps?].

All 6 comments

We don't intend to overwrite the default ctrl-c behavior. This would be a pretty bad user experience.

I'm not implying breaking the default behavior, but providing means to be able to get out of a menu by pressing some key(s) [escape perhaps?].

... and in fact right now, if you press ctrl-c it goes into a "locked" state and you need to press ctrl-c again to get out of it, so something seems to be indeed messing with the default behavior.

I would like to second this issue. I ran across this scenario today.

I want this feature to be done from the software side. So some delayed handler can be executed, and if the user has not provided something within a limited period of time (or for some other reason - something has happened in the system, and its state has been changed, so there is no reason to prompt), javascript code should be able to break out of existing prompt.

I added PoC interruption mechanism here: https://github.com/ro31337/Inquirer.js#modified-by-roman-pushkin

Commit: https://github.com/ro31337/Inquirer.js/commit/954f94616ba9d0e997be738446001354791010ec

It's for list only. I don't know if it fits the philosophy of the library, and a good way to go, so wanna hear your comments guys. @SBoudrias

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lvjiaxuan picture lvjiaxuan  路  6Comments

sindresorhus picture sindresorhus  路  4Comments

fuechter picture fuechter  路  3Comments

ro31337 picture ro31337  路  5Comments

szul picture szul  路  5Comments