franciscolourenco / done

A fish-shell package to automatically receive notifications when long processes finish.
MIT License
779 stars 71 forks source link

tmux support #49

Closed toejough closed 5 years ago

toejough commented 5 years ago

AFAICT, this doesn't work with tmux.

OS: MacOS 10.14.5 Terminal: iTerm2 3.3.0beta5 tmux: 2.9a fish: 3.0.2

without tmux, this works as expected. With tmux, I get no notifications.

franciscolourenco commented 5 years ago

@toejough it does work for me. Are you logging into a remote server or local tmux server?

toejough commented 5 years ago

Local

On Sat, May 25, 2019, 10:23 AM Francisco Lourenço notifications@github.com wrote:

@toejough https://github.com/toejough it does work for me. Are you logging into a remote server or local tmux server?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/franciscolourenco/done/issues/49?email_source=notifications&email_token=ABISFQF2LGZDIWTFS5INYUTPXFDVZA5CNFSM4HPSOHG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWHSYJQ#issuecomment-495922214, or mute the thread https://github.com/notifications/unsubscribe-auth/ABISFQGI3K7EBVNXMOXTZPDPXFDVZANCNFSM4HPSOHGQ .

franciscolourenco commented 5 years ago

@toejough The following steps work for me using the same versions. They don't work for you?

  1. Type sleep 15
  2. Switch to another application
  3. Wait 15 seconds
  4. Receive notification.
toejough commented 5 years ago

No... :-/

I appreciate your responsiveness & repro attempts! I'm not sure what the difference could be now.

I've:

Is there any log I can look at to debug this further?

toejough commented 5 years ago

(I also tried sleep 15, to be sure it's not about edge cases)

toejough commented 5 years ago

FWIW, terminal-notifier -message YO shows the expected notification both in iterm and in tmux (even with my custom .tmux.conf).

toejough commented 5 years ago

...I'm no longer having this issue. I did uninstall terminal-notifier, and then a few days later this plugin started working and it caught me totally off guard.

I reinstalled terminal-notifier, and everything still works. I'm very confused, but I'll close the issue.

toejough commented 5 years ago

Also, now that it's working for me, I find this really cool. Thank you for making it!

franciscolourenco commented 5 years ago

Thanks for the update!

gpanders commented 4 years ago

Unfortunately I'm having a similar issue:

  1. Works when not in tmux
  2. Does not work in tmux
  3. Works when terminal-notifier is not installed (uses osascript instead)

I have tried uninstalling and re-installing terminal-notifier but this did not change anything.

FWIW, I've noticed that the following

terminal-notifier -message "Hi" -title "Foo" -sender "tmux" -activate "$__done_initial_window_id"

does not work, but omitting the -sender argument does work:

terminal-notifier -message "Hi" -title "Foo" -activate "$__done_initial_window_id"

So I think there might be a problem with -sender "tmux".

EDIT: From terminal-notifier's README under the -sender option:

Because of this it is important to note that you cannot combine this with options like -execute and -activate which depend on the sender of the notification to be ‘terminal-notifier’ to perform its work.

Commenting out the following lines causes it to work:

if test $TMUX
    set sender "tmux"
end
franciscolourenco commented 4 years ago

@gpanders 1.8.2 should fix the issue. Can you confirm? Thanks

gpanders commented 4 years ago

Yes that seems to have fixed it. Thanks!