mirror of
https://github.com/github/gh-stack.git
synced 2026-09-14 20:26:28 +08:00
24e18bd088
When Ctrl+C is pressed during a prompter interaction, the CLI now prints a friendly 'Received interrupt, aborting operation' message instead of ugly wrapped errors like 'failed to read prefix: could not prompt: interrupt'. Changes: - Add isInterruptError(), printInterrupt(), and errInterrupt sentinel to cmd/utils.go for centralized interrupt detection - Update all 8 prompt sites (init, push, checkout, utils) to detect survey's terminal.InterruptErr and exit cleanly - Update callers of resolveStack, pickRemote, and ensureRerere to propagate interrupt without double-printing errors - Change ensureRerere signature to return error so callers can abort on interrupt - Add tests for interrupt detection helpers Closes td-746bdc Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>