Skip to content

Conversation

@forketyfork
Copy link
Owner

Solution:

  • Handle SDL window close/destroy events and suppress Cmd+W-triggered close requests on macOS so terminal-close doesn"t tear down the window.
  • Exit the main loop immediately after quit to avoid post-close processing.
  • Clarify Cmd+W vs quit behavior in README/configuration docs.

Issue: App crashed on macOS when closing a terminal with Cmd+W (see crash report) and needs safe close handling.

Solution: handle SDL window close/destroy events and suppress Cmd+W-triggered close requests on macOS to avoid tearing down the window.

Solution: exit the main loop immediately after quit and document Cmd+W vs quit behavior.
@forketyfork forketyfork requested a review from Copilot January 23, 2026 10:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR handles window close requests on macOS to prevent Cmd+W from closing the application window while allowing proper quit behavior through Cmd+Q or the window close button.

Changes:

  • Added SDL window close event handling with macOS-specific suppression of Cmd+W-triggered close requests
  • Updated main loop to exit immediately after quit is requested
  • Clarified the distinction between Cmd+W (terminal close) and Cmd+Q/window close button (application quit) in documentation

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/c.zig Exported SDL window close and destroy event constants
src/app/runtime.zig Implemented Cmd+W suppression logic and window close event handlers
docs/configuration.md Updated documentation to clarify Cmd+W vs quit behavior
README.md Updated keyboard navigation description to distinguish terminal close from application quit

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Addresses review comments 2720612556, 2720612576, 2720612588.
@forketyfork forketyfork merged commit 3ceb722 into main Jan 23, 2026
4 checks passed
@forketyfork forketyfork deleted the fix/cmdw-close-request branch January 23, 2026 10:37
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