julienXX / terminal-notifier

Send User Notifications on macOS from the command-line.
Other
6.38k stars 330 forks source link

-open is not working with "file:///" or "file://localhost/" or "file://$HOSTNAME/" #253

Open tjluoma opened 6 years ago

tjluoma commented 6 years ago

Please check everything that applies to your issue:

It appears that similar problems have been discussed before https://github.com/julienXX/terminal-notifier/issues/181 and https://github.com/julienXX/terminal-notifier/issues/215 but I'm having the issue with terminal-notifier 2.0.0.

I just started using terminal-notifier again, so I'm not sure if this is a new issue or not

Nope, I'm just trying to run it in a shell script or at the command-line.

To help us debug your issue please include:

ProductName: Mac OS X ProductVersion: 10.13.6 BuildVersion: 17G65

2.0.0

homebrew

First, I tried "file:///" and got an error:

Here is what I tried:

terminal-notifier -message "This is the Message" -title "This is the Title" -group "zsh" -subtitle "Click to see Conflicts in Finder" -open "file:///Users/luomat/Library/Saved Searches/Dropbox-Conflicted-Copies.savedSearch"

And here is the error message:

2018-07-15 20:33:27.612 terminal-notifier[21441:193711] 'file:///Users/luomat/Library/Saved Searches/Dropbox-Conflicted-Copies.savedSearch' is not a valid URI.

Then I saw the suggestion to try 'localhost' so I tried that instead:

terminal-notifier -message "This is the Message" -title "This is the Title" -group "zsh" -subtitle "Click to see Conflicts in Finder" -open "file://localhost/Users/luomat/Library/Saved Searches/Dropbox-Conflicted-Copies.savedSearch"

But still got the same error:

2018-07-15 20:32:27.853 terminal-notifier[21346:192439] 'file://localhost/Users/luomat/Library/Saved Searches/Dropbox-Conflicted-Copies.savedSearch' is not a valid URI.

Last, I tried "$HOST" (I tried "$HOSTNAME" but apparently zsh uses "$HOST" instead)

terminal-notifier -message "This is the Message" -title "This is the Title" -group "zsh" -subtitle "Click to see Conflicts in Finder" -open "file://$HOST/Users/luomat/Library/Saved Searches/Dropbox-Conflicted-Copies.savedSearch"

But still an error:

2018-07-15 20:31:37.436 terminal-notifier[21255:191109] 'file://m1.local/Users/luomat/Library/Saved Searches/Dropbox-Conflicted-Copies.savedSearch' is not a valid URI.

Common issues and solution:

Not using tmux

I am using iTerm, but I tried in Terminal.app and got the exact same errors

julienXX commented 6 years ago

Hi @tjluoma sorry been quite busy these days, I'll have a look pretty soon.