Skip to content

Commit 072e26d

Browse files
authored
reject toPrompt promise on exit (eg with ESC key)
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
1 parent 5f0d429 commit 072e26d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/prompts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function toPrompt(type, args, opts={}) {
1111
const onExit = opts.onExit || noop;
1212
p.on('state', args.onState || noop);
1313
p.on('submit', x => res(onSubmit(x)));
14-
p.on('exit', x => res(onExit(x)));
14+
p.on('exit', x => rej(onExit(x)));
1515
p.on('abort', x => rej(onAbort(x)));
1616
});
1717
}

0 commit comments

Comments
 (0)