Skip to content

Commit

Permalink
reject toPrompt promise on exit (eg with ESC key)
Browse files Browse the repository at this point in the history
this is an open issue in the library: terkelg#362

here's a fix for this that someone made a while ago (which has not been merged for some reason): terkelg#369

This PR makes the same fix in our internal fork
  • Loading branch information
TakshPSingh authored Feb 5, 2024
1 parent 5f0d429 commit 072e26d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function toPrompt(type, args, opts={}) {
const onExit = opts.onExit || noop;
p.on('state', args.onState || noop);
p.on('submit', x => res(onSubmit(x)));
p.on('exit', x => res(onExit(x)));
p.on('exit', x => rej(onExit(x)));
p.on('abort', x => rej(onAbort(x)));
});
}
Expand Down

0 comments on commit 072e26d

Please sign in to comment.