From 056b1441741b0757eb76e0ede527a1bc6aba459d Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sun, 14 Dec 2025 21:36:57 +0900 Subject: [PATCH] fix(session-notification): gracefully handle notify-send failures on WSL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add .catch() to notify-send command to prevent GDBus.Error logs when org.freedesktop.Notifications service is unavailable in WSL environments. Fixes #47 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/hooks/session-notification.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/session-notification.ts b/src/hooks/session-notification.ts index d3147d8..af638ec 100644 --- a/src/hooks/session-notification.ts +++ b/src/hooks/session-notification.ts @@ -56,7 +56,7 @@ async function sendNotification( await ctx.$`osascript -e ${"display notification \"" + escapedMessage + "\" with title \"" + escapedTitle + "\""}` break case "linux": - await ctx.$`notify-send ${escapedTitle} ${escapedMessage}` + await ctx.$`notify-send ${escapedTitle} ${escapedMessage}`.catch(() => {}) break case "win32": await ctx.$`powershell -Command ${"[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('" + escapedMessage + "', '" + escapedTitle + "')"}`