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:
@@ -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 + "')"}`
|
||||
|
||||
Reference in New Issue
Block a user