The abort error does not pass the last highlighted or selected elements along.
Problem:
Last state is unknown.
For legacy Inquirer there was some rxjs way of accessing the options? or selections? Is there something similar to work araound this issue?
import { select, checkbox } from '@inquirer/prompts';
let currentAbortController = new AbortController();
setTimeout(_ => currentAbortController.abort(), 2000);
let selection = await checkbox({
message: 'Select something',
choices: choices,
}, {
signal: currentAbortController.signal,
clearPromptOnDone: true
}).catch(e => {errorWith: error.lastSelected}) ; // <-- this would be missing: error.lastSelected
if (selection.errorWith) {
console.log('errored');
selection = selection.errorWith;
}
console.log('selection', selection);