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 committed Feb 5, 2024
1 parent 5f0d429 commit 2560401
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 2560401

Please sign in to comment.