Skip to content

macOS: URL scheme handler lost after restart (unsigned app bundle) #22

Description

@tupe12334

Problem

After running worktree setup, the WorktreeRunner.app bundle is installed at ~/Applications/WorktreeRunner.app and lsregister registers the worktree:// URL scheme. However, the app bundle is not code-signed, so macOS Gatekeeper removes or invalidates it — typically after a reboot or a Launch Services database reset — causing the worktree:// scheme to stop working and macOS to show the "No application set to open this URL" dialog.

Steps to Reproduce

  1. Run worktree setup
  2. Confirm worktree scheme status reports installed
  3. Reboot the machine
  4. Click a worktree:// deep link
  5. macOS shows "There is no application set to open the URL"

Root Cause

osacompile produces an unsigned .app bundle. Gatekeeper quarantines or evicts unsigned app bundles from ~/Applications/ over time.

Possible Fixes

  • Ad-hoc code sign the generated bundle after osacompile using codesign --sign - --force --deep (ad-hoc signing satisfies Gatekeeper for locally-built tools without requiring a paid Apple Developer certificate)
  • Re-register on login via a launchd plist in ~/Library/LaunchAgents/ that runs worktree scheme install at login, so the scheme is re-registered automatically if it gets evicted
  • Both approaches can be combined for maximum resilience

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions