Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(shell): isolate ObjC exceptions in the macOS window shell bridge (#265)

2 months ago

3b2b4b0
Authored
Davy7/26/2026, 11:02:27 AM
ok_window_shell_configure_main_window applies AppKit chrome inside a
Rust->C callback. Any NSException raised there unwound through the
extern "C" boundary, which Rust converts into panic_cannot_unwind: the
process aborted before a window ever appeared and the crash log kept
only "panic in a function that cannot unwind" instead of the AppKit
reason.

Wrap the configuration block in @try/@catch. The catch logs the
exception and leaves `configured` false, which window_shell.rs already
treats as "fall back to the default mac shell profile" - the app loses
cosmetic chrome instead of dying.

Verified by compiling the real bridge, plus a temporary raising probe,
into a standalone AppKit harness: the pre-change file aborts with
SIGABRT on an uncaught NSUnknownKeyException, the hardened file logs
and returns false.

Closes #261

Parent18ea7ac

1 file changed
  • src-tauri/src/macos/window_shell.m+77−61