microsoft / microsoft/FluidFramework
Extract isUserCancellation to a shared location for @inquirer/prompts callers
@tylerbutler is already working on this.
Since Apr 14, 2026.
- Dominant language
- TypeScript
- Stars
- 4.9k
- Forks
- 586
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 146
Description
Summary
build-tools/packages/build-cli/src/commands/ai.ts defines an isUserCancellation helper (lines 335-342) that detects ExitPromptError, AbortError, and cancellation-related error messages from @inquirer/prompts. This is currently the only place in build-cli that handles prompt cancellation gracefully.
Other commands that use @inquirer/prompts (confirm, rawlist) — including bump.ts, release.ts, release/report.ts, and handlers/checkFunctions.ts — do not catch cancellation at all. Pressing Ctrl+C in those commands produces an unhandled rejection and a raw stack trace.
Proposal
Move isUserCancellation to a shared location (e.g. src/library/prompt.ts) and adopt it in the other @inquirer/prompts callers so that Ctrl+C exits cleanly across all interactive commands.
Context
Identified during code reuse review of the flub ai PR. Deferred because applying the fix across all callers is a broader change.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.