Skip to content

feat: add CLI exit handler and improve cancel behavior in prompts#93

Merged
felipefreitag merged 5 commits intoresend:mainfrom
Shubhdeep12:feat/global-cli
Mar 18, 2026
Merged

feat: add CLI exit handler and improve cancel behavior in prompts#93
felipefreitag merged 5 commits intoresend:mainfrom
Shubhdeep12:feat/global-cli

Conversation

@Shubhdeep12
Copy link
Contributor

@Shubhdeep12 Shubhdeep12 commented Mar 13, 2026

related #90


Summary by cubic

Adds a global CLI exit handler for consistent Ctrl+C and unhandled error behavior. Cancelling prompts now exits 130; unhandled errors print a message and exit 1.

  • New Features
    • Register setupCliExitHandler() at startup; Ctrl+C prints "Cancelled." and exits 130.
    • On uncaughtException, send message via outputError with code unexpected_error, then process.exit(1); cancelAndExit() now uses getCancelExitCode().

Written for commit 5264736. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@Shubhdeep12
Copy link
Contributor Author

hey @felipefreitag any thoughts here?

felipefreitag and others added 2 commits March 18, 2026 15:13
Without process.exit(1), the process stays alive in an undefined
state after an unhandled exception.
@felipefreitag felipefreitag merged commit a15eef7 into resend:main Mar 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants