Npm-check-updates: Ctrl-C does not abort interactive session

Created on 10 Feb 2020  路  3Comments  路  Source: raineorshine/npm-check-updates

  • [x] I have read the list of known issues before filing this issue.
  • [x] I have searched for similiar issues before filing this issue.

  • node version: 12.7.0

  • npm version: 6.10
  • npm-check-updates version: 3.2.0

I have tried several times to test the interactive option for this tool, and very often I want to abort the process and so I press Ctrl-C to send a signal to quit the ongoing operation. This is not respected by the tool, which for some reason has chosen to interpret this as a YES to the current question. This is a highly unconventional choice :smile:

I would like to signal listener to interpret Ctrl-C as a signal to do process.exit(1) or at least give the user a prompt to quit.

bug

Most helpful comment

I tend to agree. npm-check-updates uses the package prompts which does seem to support detection of Ctrl + C.

All 3 comments

I tend to agree. npm-check-updates uses the package prompts which does seem to support detection of Ctrl + C.

There are various ways of achieving this, though one might need to resort to hacks like this for some cases: https://github.com/terkelg/prompts/issues/252#issue-559780869 (actively avoids printing a "Y").

Hello,
I met this bug and i encourage its fix :)

Thank you for your work.

Was this page helpful?
0 / 5 - 0 ratings