github julienXX/terminal-notifier 3.0.0

3 hours ago

First release in nine years. terminal-notifier is rebuilt on Apple's
UserNotifications framework because the old NSUserNotification API was
deprecated in macOS 11 and had been breaking progressively since.

Everyday use does not change. -message, -title, -subtitle, -group,
-remove, -list and the click actions all work the same way. Three options
could not be carried over.

Requires macOS 10.14 or higher. The binary is universal and runs natively
on Apple silicon and Intel. Stay on 2.0.0 for older systems.

Removed

Option Why
-sender It worked by swizzling terminal-notifier's own bundle identifier. UserNotifications reads the real signed identity so there is nothing to override. It had been hanging or silently doing nothing for years.
-appIcon Notification content has no icon property in the public API. The icon always comes from the sending bundle. Broken since Big Sur.
-ignoreDnD It set a private flag. The public equivalent needs an entitlement Apple grants on request, which this build does not carry.

All three are still accepted and print a warning, so existing scripts keep
running. They have no effect.

For a custom icon use make icon ICON=logo.png APP_NAME=my-tool, which builds
a copy of the app with your image.

Changed

  • -contentImage takes local files only. Version 2 accepted remote URLs, the
    attachment API does not.
  • Exit codes 2 to 6 were added to tell a bad argument from a permissions
    problem from a timeout. Scripts testing for a non-zero status are unaffected.
    Scripts testing for exactly 1 should be checked.

New

  • -action TITLE and -reply [PROMPT] bring back action buttons and inline
    replies, removed in 2.0.0 because the old implementation used private API.
    These wait for the user and print the answer on stdout, so a script can
    branch on it.
  • -timeout SECONDS bounds that wait.
  • -diagnose reports why a notification is not appearing: authorization,
    alert style, sounds, Focus, Scheduled Summary and whether Notification
    Center is running.
  • make build and make doctor, so terminal-notifier can be built and
    verified without installing Xcode. make doctor checks every documented
    option and prompts you for the ones only a person can judge.

Fixed

  • Notifications sent without -group no longer replace each other.
  • -remove removes delivered notifications.
  • -open, -execute and -activate fire reliably on click. A stale
    background process no longer blocks them.
  • -contentImage no longer deletes the image you pass it.
  • Modern sound names work.
  • Tabs and newlines in a title or message no longer corrupt -list output.
  • -remove and -list no longer hang when stdin is an open pipe.
  • Failures are reported on stderr instead of failing silently.
  • Running over SSH or from launchd exits with a diagnostic instead of hanging.
  • No private API and no bundle identifier swizzling remain, so
    terminal-notifier is App Store compatible again.

Ruby gem

gem install terminal-notifier requires Ruby 3.2 or newer. :action and
:reply return the answer. A timeout returns :_timeout rather than false,
so it can be told apart from a delivery failure.

Thanks to @billdaws, whose UserNotifications migration in #322 was the
starting point for this work.

Don't miss a new terminal-notifier release

NewReleases is sending notifications on new releases.