Skip to content

Commit

Permalink
reject toPrompt promise on exit (eg with ESC key) (#8)
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 to our fork
  • Loading branch information
TakshPSingh authored Feb 5, 2024
1 parent 5f0d429 commit d0a0fc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@withgraphite/prompts",
"version": "0.0.1",
"version": "0.0.2",
"description": "Lightweight, beautiful and user-friendly prompts",
"license": "MIT",
"repository": "withgraphite/prompts",
Expand Down

0 comments on commit d0a0fc1

Please sign in to comment.