Skip to content

Spinner interrupt exit code differs between the Rust and TypeScript implementations #3429

Description

@jong-kyung

Vite+ has two spinner implementations, and they exit with different codes when the user interrupts them.

Rust spinner TypeScript spinner
Location crates/vp_shared/src/progress/input.rs packages/prompts/src/spinner.ts
Example commands vp install -g, vp upgrade Interactive vp migrate, vp create
Ctrl+C Ends by SIGINT, exit code 130 Exit code 0
SIGTERM Ends by SIGTERM, exit code 143 Keeps running, then exit code 0

The TypeScript spinner should match the Rust spinner, so that an interrupted command does not report success. For example, vp migrate && git commit currently continues to the commit after Ctrl+C.

Cause

  • block() from @clack/core switches stdin to raw mode and calls process.exit(0) when it receives Ctrl+C.
  • The spinner's SIGINT and SIGTERM listeners stop the spinner and return, so Node keeps the process running.

Activity

  1. jong-kyung commented on Nov 11, 2026

    @jong-kyung
    CollaboratorAuthor

    @fengmk2 Should we make the exit codes consistent here?

  2. self-assigned this
    on Nov 11, 2026
  3. fengmk2 commented on Nov 11, 2026

    @fengmk2
    Member

    We need to standardize this, and also consider which exit code would be most appropriate.

  4. jong-kyung commented on Nov 11, 2026

    @jong-kyung
    CollaboratorAuthor

    We need to standardize this, and also consider which exit code would be most appropriate.

    I think we should match the Rust spinner. It lets the signal end the process, so the shell reports 130 for Ctrl+C and 143 for SIGTERM.

  5. added a commit that references this issue on Nov 12, 2026
    851a1e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions