matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Desktop notifications fail silently when notify-send/osascript unavailable

Open andrinoff opened this issue 7 months ago • 2 comments

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

  1. On a Linux system without notify-send installed (or a Wayland session without libnotify)
  2. Receive a new email while matcha has notifications enabled
  3. 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

andrinoff avatar Apr 15 '26 19:04 andrinoff

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.

floatpanebot avatar May 16 '26 05:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar May 30 '26 05:05 floatpanebot