fix(session-notification): gracefully handle notify-send failures on WSL

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)
This commit is contained in:
YeonGyu-Kim
2025-12-14 21:36:57 +09:00
parent 7fef07da2e
commit 056b144174

View File

@@ -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 + "')"}`