Skip to content

fix: handle macOS deep-link URLs via Apple Event handler#23

Open
190km wants to merge 1 commit intomainfrom
fix/macos-deeplink
Open

fix: handle macOS deep-link URLs via Apple Event handler#23
190km wants to merge 1 commit intomainfrom
fix/macos-deeplink

Conversation

@190km
Copy link
Copy Markdown
Owner

@190km 190km commented Mar 30, 2026

Summary

Fixes void:// deep-link navigation on macOS. Links from browser or open command open Void but don't navigate to the target location.

Root cause: On macOS, URL scheme activations are delivered via Apple Events (kAEGetURL), not as command-line arguments like on Windows/Linux. The app was only checking std::env::args(), so the URL was silently dropped.

Fix: Register an Objective-C Apple Event handler (NSAppleEventManager + kAEGetURL) on macOS that captures the URL and feeds it into the existing pending_deeplink mechanism. Handles both cold start (app not running) and warm activation (app already running).

  • All new code is behind #[cfg(target_os = "macos")] — zero impact on Windows/Linux
  • Uses objc2 (already in dependency tree via arboard)

Reported by @luketych in #17.

Test plan

  • macOS: open "void://open/<workspace-id>/@0,0,1.0" from Terminal → app navigates
  • macOS: Click void:// link in browser → app navigates
  • macOS: Quit app, then open "void://..." → app launches AND navigates
  • Windows/Linux: Existing deep-link behavior unchanged

On macOS, void:// URL activations are delivered via Apple Events
(kAEGetURL), not as CLI arguments. Uses the Carbon AEInstallEventHandler
API to capture URLs and feed them into the existing pending_deeplink
mechanism. Handles both cold start and warm activation.

All new code is behind #[cfg(target_os = "macos")].
@190km 190km force-pushed the fix/macos-deeplink branch from a9f3912 to c986902 Compare March 31, 2026 00:15
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.

1 participant