-
-
Notifications
You must be signed in to change notification settings - Fork 314
Open
Description
Describe the bug
Title says it all ~ A prompt of type "select" does not run onCancel() when ESC is pressed.
To Reproduce
Create a prompt w/ a onCancel arrow method, like..
const response = await prompts(
[
{
name: 'pick',
type: 'select',
message: 'Pick a choice',
choices //: [..],
},
],
{
onCancel: () => {
console.log('» Interrupted by user');
process.exit(1);
},
},
);Run your program, press "ESC" as you encounter the prompt.
Expected behavior
Pressing "ESC" to cancel should invoke the onCancel() method, exiting the process
System
- OS: wsl Linux, Ubuntu
- (
Linux C-5CG4301X0H 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux) - Terminal: bash
- Node version: v22.15.0
Metadata
Metadata
Assignees
Labels
No labels