tmux-plugins / tmux-continuum

Continuous saving of tmux environment. Automatic restore when tmux is started. Automatic tmux start when computer is turned on.
MIT License
3.31k stars 149 forks source link

macOS Ventura: "Background Item Added" notification on each boot #118

Closed erikw closed 10 months ago

erikw commented 1 year ago

Hello, first thanks for an amazing tool! This has really simplified my own homegrown hacky solution of several bash and apple scripts I had developed to preserve my tmux env on reboot.

However now since macOS 13 Ventura on a system with tmux-continuum configured with Automatic Tmux start, each time the system boots up there is now a notification". This notification is a bit annoying - it's useful the first time but not anything one needs to see every boot.

Screenshot 2023-01-30 at 10 40 30

The other app in this screenshot, Clipy, has an open issue for this very same problem: https://github.com/Clipy/Clipy/issues/519 from maybe we can learn a bit on how to solve this!

erikw commented 1 year ago

I notice that these notifications comes also when starting a new tmux session in general; it came even 2 times when I started a new tmux session (with no other running already)

Screenshot 2023-02-01 at 11 00 33

paulhdk commented 1 year ago

Hi!

Facing the same problem. Any update on this?

Also, @erikw , is the script working for you at all? I get the notifications, but iTerm isn't starting reboot.

erikw commented 1 year ago

@PBHDK iTerm does start for me at boot still.

bruno- commented 1 year ago

I confirm I get the same behavior ("Background Item Added" notification) after every reboot.

This may have to do with writing the launchd plist file every time tmux-continuum runs:

https://github.com/tmux-plugins/tmux-continuum/blob/9329afa932f3b519d1b6665c58b795bcdbed4bc2/scripts/handle_tmux_automatic_start/osx_enable.sh#L68

If someone wants to troubleshoot this:

d8n1z commented 1 year ago

can confirm that commenting line 68 out works out, as @bruno- suggested. A good PR any1?

> sw_vers
ProductName:            macOS
ProductVersion:         13.2.1
BuildVersion:           22D68
---
> cat .tmux.conf
...
# save interval
set -g @continuum-restore 'on'
set -g @continuum-save-interval '15'

# auto-start at boot
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm'
...
nk-tedo-001 commented 1 year ago

I confirm I get the same behavior ("Background Item Added" notification) after every reboot.

This may have to do with writing the launchd plist file every time tmux-continuum runs:

https://github.com/tmux-plugins/tmux-continuum/blob/9329afa932f3b519d1b6665c58b795bcdbed4bc2/scripts/handle_tmux_automatic_start/osx_enable.sh#L68

If someone wants to troubleshoot this:

  • I'd first check if the notification pops if the above line is commented out.
  • If that fixes the problem, then I think we only want to write launchd plist file if the template content changed.

I try to comment this line and then run tmux source .tmux.conf no popup showed up. When I uncomment and re-run the command, the popup appears.