During one of the macOS updates (26.2?), Apple somehow introduced an ObjC exception that sometimes triggers when a new tab is created while in the tab overview. Swift CANNOT CATCH ObjC exceptions. Instant crash. This affected Ghostty as well as Electron (unrelated project).

The fix is equally crazy: write an ObjC wrapper around the crashy-function, catch it, and basically retry periodically. This is 100% an Apple bug, but the way it manifests and the fix required to workaround it is pretty gnarly.

Credit to everyone but me, I didn't do any research here, I only read the good work by others on this one (all visible in the refs).

Ref: github.com/ghostty-org/ghostty
Ref: github.com/electron/electron/i

0

If you have a fediverse account, you can quote this note from your own instance. Search https://hachyderm.io/users/mitchellh/statuses/116133365454755683 on your instance and quote it. (Note that quoting is not supported in Mastodon.)