Skip to content

Fix preferences, shortcuts, login launch, and Finder extension on macOS 27 - #281

Open
chillednems wants to merge 3 commits into
Ji4n1ng:masterfrom
chillednems:agent/fix-macos-27-preferences-hotkeys
Open

Fix preferences, shortcuts, login launch, and Finder extension on macOS 27#281
chillednems wants to merge 3 commits into
Ji4n1ng:masterfrom
chillednems:agent/fix-macos-27-preferences-hotkeys

Conversation

@chillednems

Copy link
Copy Markdown

Summary

  • make preferences durable across app quits and reboots by selecting a defaults store the current signature can actually access
  • migrate recognized preferences from the legacy App Group without overwriting newer values
  • register ShortcutRecorder actions even when no shortcut exists at launch so newly configured shortcuts become active immediately
  • replace the deprecated login-item path with SMAppService.mainApp on macOS 13 and newer while preserving the legacy helper for older releases
  • restore Finder context menus and the toolbar item by keeping / in the FinderSync monitored scope and providing safe fallback actions
  • correct the shared App Group identifier and related configuration documentation

Root causes

The main app and Finder extension used group.wang.jianing.app.OpenInTerminal unconditionally. UserDefaults(suiteName:) can return an object even when the process cannot access the corresponding container, which made writes appear successful without remaining durable. The updated code uses the Team-prefixed App Group for official builds, verifies the current signing Team ID and container access, and falls back to the process's standard defaults domain for ad-hoc or differently signed builds.

Shortcut actions were only added to GlobalShortcutMonitor when a shortcut was already non-nil. That prevented ShortcutRecorder from observing actions configured after launch.

Launch at login relied only on deprecated SMLoginItemSetEnabled, and the compatibility helper checked an incorrect main-app bundle identifier. Modern systems now use SMAppService.mainApp and surface the system approval state.

The Finder extension depended entirely on visible mounted-volume enumeration. On macOS 27 it could be enabled and running while having no useful Finder scope. The extension now always includes /, adds other visible volumes, and no longer returns an empty menu when shared preferences are unavailable. The containing app's obsolete NSExtension declaration was also removed; the declaration remains on the embedded .appex.

Validation

Local checks:

  • Debug and Release macOS builds pass
  • Release build contains universal arm64 and x86_64 executables
  • isolated defaults persistence, legacy migration, and reset probe passes
  • ShortcutRecorder action-update registration probe passes
  • ad-hoc leaf-first signing passes strict deep verification
  • packaged ZIP passes integrity testing and strict verification after extraction

Device validation on macOS 27.0 beta (26A5388g, Apple silicon):

  • preferences persist after quitting and restarting OpenInTerminal
  • configured terminal, editor, and Copy Path shortcuts work
  • menu-bar Terminal, editor, and Copy Path actions work
  • Launch at Login starts OpenInTerminal after restarting macOS
  • Finder context menus and the toolbar icon appear after the monitored-scope fix
  • ad-hoc Finder fallback actions expose Terminal, TextEdit, and Copy Path

Remaining signing validation

The test artifact is ad-hoc signed and therefore has no Team ID. It correctly exercises the standard-defaults fallback, but it cannot access the upstream App Group. Please rebuild with the existing C8VX3ZLX5U Developer ID identity and confirm that the main app and Finder extension share the selected terminal and editor through C8VX3ZLX5U.wang.jianing.app.OpenInTerminal.

@chillednems
chillednems marked this pull request as ready for review July 29, 2026 19:55
@chillednems

chillednems commented Jul 29, 2026

Copy link
Copy Markdown
Author

I have a build of the app in the fork.
https://github.com/chillednems/OpenInTerminal/releases/tag/macos27-test-d29d00d

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