antfu-collective / ni

💡 Use the right package manager
MIT License
6.36k stars 209 forks source link

Escape key behaves like Enter in interactive mode #236

Open qadzek opened 2 weeks ago

qadzek commented 2 weeks ago

Describe the bug

Thank you for this wonderful tool.

When I run a command that allows me to make a selection interactively (e.g. nr) and I change my mind, I hit the Escape key, expecting to return to the command line. However, instead of returning, the selected script is executed, just as if I had hit Enter.

The only difference between hitting Enter and Escape is that in the former case ✔ script to run › test is displayed, while in the latter ✖ script to run › test appears. In both cases the script is run.

Reproduction

Seems not applicable

System Info

This occurs both on a workstation and a VPS. For instance:

System:
  OS: Linux 6.5 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
  CPU: (2) x64 AMD EPYC 7551 32-Core Processor
  Memory: 262.68 MB / 947.50 MB
  Container: Yes
  Shell: 5.8.1 - /usr/bin/zsh
Binaries:
  Node: 20.17.0 - /usr/bin/node
  npm: 10.8.2 - /usr/bin/npm
Browsers:
  Chromium: 128.0.6613.137

Used Package Manager

npm

Validations

Contributions

antfu commented 2 weeks ago

PR welcome, thanks!

babu-ch commented 1 week ago

I think this is probably related :eyes: https://github.com/terkelg/prompts/pull/369