manifoldco / promptui

Interactive prompt for command-line applications
https://www.manifold.co
BSD 3-Clause "New" or "Revised" License
6.03k stars 333 forks source link

Prompt interrupt not catched #102

Closed denouche closed 5 years ago

denouche commented 5 years ago

Hello, When I use the basic prompt the Ctrl-C interrupt is never catched, and the error is never throwed. I found the origin of the bug, I will make a PR.

ItalyPaleAle commented 4 years ago

I am still having issues. When there's a prompt, pressing CTRL+C doesn't interrupt the application.

richardzcode commented 3 years ago

In case anybody wondered. When CTRL+C pressed you'll get an err. Just need to check it. It is pretty obvious but developers new to promptui and go may scratch their head for some minutes.

thiskevinwang commented 2 years ago

~@ItalyPaleAle / @richardzcode I'm a developer new to promptui and I'm scratching my head 😅 — do you have an example of how to catch Ctrl + C in promptui?~

Nevermind! figured it out:

index, result, err = prompt.Run()
// check this err