raineorshine / npm-check-updates

Find newer versions of package dependencies than what your package.json allows
Other
9.15k stars 317 forks source link

interactive CLI has no quit or exit command. #1414

Open vassudanagunta opened 1 month ago

vassudanagunta commented 1 month ago

Currently the only way, AFAIK, is to issue a terminal kill command. You can also press ENTER and then not ENTER but n at the next prompt (which is unintuitive when looking at the initial list).

Ideally q or x to exit with nothing upgraded or changed.

If agreed, I can take a stab at a PR when I get some free time.

raineorshine commented 1 month ago

Thanks for the suggestion. I'd be happy with q for quit.

ZaLiTHkA commented 1 month ago

just thinking out loud here, but perhaps this could be "fixed" by simply updating the input descriptions for interactive mode?

pressing "escape" cancels the interactive mode prompt, returning the user to their terminal, as (I imagine) the OP would expect q or x to do.

vassudanagunta commented 1 month ago

@ZaLiTHkA Good to know. But not very obvious or intuitive: In my experience, ESC is a standard idiom for cancellation in GUI apps. If I am remembering correctly, all the CLIs I've used exit on q or x. If I am not, I would suggest that it match most user expectations / CLI conventions. For me personally, I am fine with ESC.

ZaLiTHkA commented 1 month ago

@vassudanagunta I agree with you on that point, it's definitely not very "intuitive" as it is right now.

on the other hand, the fact that there is already a mechanism in place to "cancel" interactive mode also means that adding support for a q or x shortcut to do the same thing shouldn't need entirely new functionality, just a small adjustment to which key actually triggers it.

either way, a short message in the initial usage notes would clear this up for everyone.