Closed sashkab closed 6 years ago
Only log I see in the console when I ran terminal-notifier is this:
$ terminal-notifier -message xxxx -title xxxxx
default 22:04:14.694762 -0400 CommCenter #I CSIAppInfo.ApplicationActivationObserver: handleLSNotitifcation_sync: Application exited: <private>
I appear to have the same behavior with 1.8.0 on OSX 10.12.4. I downgraded to 1.7.2 using gem install terminal-notifier -v 1.7.2
and it's working again. I tried a dtruss to get more details but I didn't see anything obvious
I should also note that I had originally installed via homebrew
This is happening for me as well. Downgrading to 1.7.2 per @dchenbecker works again.
Interesting observation: today I restarted my mac and upon reboot I've received hundreds of missed notifications. Since then all notifications seems to be working. I have suggestion to check if you have running instance of the terminal-notifier and kill it if you do. Why, you'd ask -- because I've received crash email from one of the crontab job, which suggests that terminal-notifier was running for about 35 days...
I had temporary success when adding -sender Finder
, but that stopped working after some time; then I switched to -sender SystemEvents
, which also only worked for a short time.
I still have the v1.7 application in my /Applications folder, and all my shell scripts that use the app's executable are working fine. The scripts that use the new 1.8 binary in /usr/local/bin directly, don't work at all. This needs a fix.
OS X 10.11.6, homebrew installation
This might not have been a terminal-notifier bug, but one of the Notification Center. Because since yesterday everything has been working again, and the interesting thing is that when it first started working again, all of a sudden the 20 previous notifications that had not been displayed before, all popped up at once. I tested it manually with the other -sender
commands that I had used (SystemEvents, Finder etc.), and there everything was. Don't know what kind of a bug this is. We'll see how long it lasts. ;)
Aaaaaaaand… now it stopped working again.
Hahaha I really love this kind of bugs 😭
You think I should just reset the whole Notification Center settings in $(getconf DARWIN_USER_DIR)/com.apple.notificationcenter/db
and try again? This almost smells like MacVoodoo.
@JayBrown well you could try maybe it will solve the issue but I guess it rooted elsewhere.
Found a solution: use the above getconf
command to print the /db
directory, cd
there, ls
, and there should be the Notification Center database, just called "db". If it's there, run sqlite3 db 'select * from app_info'
, then look (or grep
) for "terminal-notifier", "julienxx", and any entries that do not use the standard reverse URL scheme, e.g. for "System Events", if you used the -sender "System Events"
option with terminal-notifier
. The first db column is the ID assigned to the app. Then, for every relevant app-ID, you need to run sqlite3 db 'delete from app_info where app_id = <ID>'
while replacing "\<ID>" with the actual ID. Then run sudo killall usernoted
, and then terminal-notifier
works again. If necessary, you just need to change its settings again in the Notification Center preference pane.
I'll monitor this in the next weeks, because I'm running the latest terminal-notifier from /usr/local/bin, but also still have some scripts that call the executable in the original .app bundle of previous terminal-notifier versions. Currently, they're working fine side by side, but maybe that's only temporary.
Followed @JayBrown's instructions above and now it works again.
Small correction - sqlite3
needs DB file as first argument when deleting rows. Correct command is
sqlite3 db 'delete from app_info where app_id = <ID>'
Btw. after running terminal-notifier
few times, previously deleted row
42|fr.julienxx.${PRODUCT_NAME:rfc1034identifier}|14|5|41
is back in DB.
Maybe row
24|nl.superalloy.oss.terminal-notifier|8534|5|20
was the only offender.
It's been running fine so far. The weird thing, however, is that terminal-notifier is selecting some random app icon from my /Applications directory as the secondary icon, in this case the icon of the app gfxCardStatus. Seems to be another bug. :)
Could you please try the updated 2.0.0 release?
Need to rewrite my scripts for use 2.0.0 release. That explains why this stopped working again. 😠
Really? Rewrite? It's not yet on homebrew, but I'll test it soon.
Really? Rewrite?
Get rid of all the actions, I've configured and got used to.
It's not yet on homebrew, but I'll test it soon.
It's pending PR -- https://github.com/Homebrew/homebrew-core/pull/20149, FYI.
I've now tested v2.0.0 with my default notify function by simply running the script, and it seems to look good. No weird inline app icons anymore (see below; it's just the Terminal icon again). What's interesting, though, is that calling /usr/local/bin/terminal-notifier directly also works from within a script, not only the standard method of calling the .app executable: the upper notification is /usr/local/bin/, the lower is executable in /usr/local/Cellar/terminal-notifier. Was this behavior planned? I thought that v2.0.0 would return to the exlusive .app method. (?)
Now I have to go through my dozens of scripts to see if they need tweaking. Oh crap. :D
@JayBrown maybe homebrew changed the way they package bundle apps. Glad to know it's working :)
Tested it again, this time with a self-contained script running via Automator (macOS Services), and calling the binary did not work. So I assume that the .app executable should be called. If however you run a script directly on the command line, e.g. in iTerm, then calling the binary seems to work.
I'm closing this issue for now, feel free to re-open if needed.
Please check everything that applies to your issue:
To help us debug your issue please include:
step-by-step reproduction instructions:
I call it through the script, which is started via crontab. It calls terminal-notifier with following function. Calling it from Terminal has no differences -- message doesn't appear. It used to work, but around 1.8 time it was gone...
Thanks!