Unable to run 'display notification' using osascript in a tmux session If I run the following command in Apple Script Editor directly, 

display notification "Hello, world"


I can see a  notification as expected

However if I tried to invoke it via command line:

 osascript  -e 'display notification "Hello, world"'


It turns out I am running it in a tmux session. If I just ran the command in my default shell, it works as expected. 

How can I get it to work with tmux?
As @kopischke said, install or upgrade reattach-to-user-namespace may solve this problem.

If your reattach-to-user-namespace is old, notification works well after brew upgrade reattach-to-user-namespace.