Skip to content

fix: preserve defers on ctrl-c#13428

Open
Yongcheng123 wants to merge 1 commit into
cli:trunkfrom
Yongcheng123:fix/ctrl-c-defers
Open

fix: preserve defers on ctrl-c#13428
Yongcheng123 wants to merge 1 commit into
cli:trunkfrom
Yongcheng123:fix/ctrl-c-defers

Conversation

@Yongcheng123
Copy link
Copy Markdown

Summary

  • Add top-level signal-aware cancellation so ctrl-c can unwind cleanly
  • Remove the alternate-screen os.Exit path that skipped defers
  • Treat context.Canceled as user cancellation
  • Return cancellation from the Codespaces prompt path instead of hanging

Verification

  • go test ./pkg/cmdutil ./pkg/iostreams ./pkg/cmd/codespace/... ./internal/ghcmd

@Yongcheng123 Yongcheng123 requested review from a team as code owners May 14, 2026 15:16
@Yongcheng123 Yongcheng123 requested a review from BagToad May 14, 2026 15:16
@github-actions github-actions Bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed unmet-requirements and removed needs-triage needs to be reviewed labels May 14, 2026
@github-actions
Copy link
Copy Markdown

Thanks for your pull request! Unfortunately, it doesn't meet the requirements for review:

  • No linked help wanted issue found in PR description

Please update your PR to address the above. This PR will be automatically closed in 4 days if these requirements are not met.

Full contribution requirements
  1. Include a detailed description of what this PR does
  2. Link to an issue with the help wanted label (use Fixes #123 or Closes #123)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team unmet-requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant