BUG: Desktop notifications fail silently when notify-send/osascript unavailable
Describe the bug
In notify/notify.go, desktop notifications call notify-send (Linux) or osascript (macOS) directly. If these tools are not installed (common on minimal Linux installs, Wayland-only setups, or headless systems), the notification silently fails with no feedback to the user.
func Send(title, body string) error {
switch runtime.GOOS {
case "darwin":
script := fmt.Sprintf(\`display notification %q with title %q sound name "default"\`, body, title)
return exec.Command("osascript", "-e", script).Run()
case "linux":
return exec.Command("notify-send", title, body).Run()
default:
return nil
}
}
Additionally, on macOS the fmt.Sprintf with %q should handle escaping, but edge cases with certain Unicode characters could still break the AppleScript.
To reproduce
- On a Linux system without
notify-sendinstalled (or a Wayland session without libnotify) - Receive a new email while matcha has notifications enabled
- No notification appears and no error is shown in the TUI
Expected behavior
- Check if the notification tool exists before trying to call it
- Show a one-time warning in the TUI if notifications can't be delivered
- Consider supporting D-Bus notifications directly on Linux as an alternative
OS
Linux (primarily), macOS
This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.
Closing due to inactivity. Reopen if still relevant.