Skip to content

fix: always restore terminal state after errors and panics #286

Description

@jasonsuhari

Problem

Terminal setup, suspend, resume, and teardown return early on individual failures. A runtime error or panic can leave raw mode, alternate-screen, mouse capture, focus tracking, bracketed paste, or the cursor in the wrong state after GridBash exits.

Acceptance checks

  • Cleanup attempts every restoration operation even if an earlier one fails.
  • Partial setup failures roll back completed terminal changes.
  • Panics restore the terminal before the error is printed.
  • Focused tests cover cleanup ordering and error preservation where practical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus:needs-triageNeeds maintainer review and routing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions