macOS: suppress unwanted ApplePersistence spam

Every time the osascript is run the following message would clutter the user's terminal:

```
2025-06-03 17:42:31.716 osascript[87001:4802580] ApplePersistence=NO
```

`osascript` provides no option to suppress this output, and redirecting `stderr` to `/dev/null` would hide legitimate errors as well. So instead I'm selectively filtering the `stderr` to remove that message and nothing else.
This commit is contained in:
Paul 2025-06-03 17:41:54 +02:00
parent 3e9bce0072
commit ad83428fc7
No known key found for this signature in database
GPG Key ID: 6A5AE3C3DF890E0F

View File

@ -107,7 +107,8 @@ function _auto_notify_message() {
-e 'on run argv' \ -e 'on run argv' \
-e 'display notification (item 1 of argv) with title (item 2 of argv)' \ -e 'display notification (item 1 of argv) with title (item 2 of argv)' \
-e 'end run' \ -e 'end run' \
"$body" "$title" "$body" "$title" \
2> >(grep -Ev 'ApplePersistence=(NO|YES)' >&2)
else else
printf "Unknown platform for sending notifications: $platform\n" printf "Unknown platform for sending notifications: $platform\n"
printf "Please post an issue on gitub.com/MichaelAquilina/zsh-auto-notify/issues/\n" printf "Please post an issue on gitub.com/MichaelAquilina/zsh-auto-notify/issues/\n"