Suppress stderr output from Linux notification commands to fix WSL errors
- Add 2>/dev/null to notify-send, paplay, and aplay commands - Prevents DBus error logs in WSL environments (Issue #47) - Maintains existing error handling behavior with .catch() 🤖 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}`.catch(() => {})
|
||||
await ctx.$`notify-send ${escapedTitle} ${escapedMessage} 2>/dev/null`.catch(() => {})
|
||||
break
|
||||
case "win32":
|
||||
await ctx.$`powershell -Command ${"[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('" + escapedMessage + "', '" + escapedTitle + "')"}`
|
||||
@@ -70,8 +70,8 @@ async function playSound(ctx: PluginInput, p: Platform, soundPath: string): Prom
|
||||
ctx.$`afplay ${soundPath}`.catch(() => {})
|
||||
break
|
||||
case "linux":
|
||||
ctx.$`paplay ${soundPath}`.catch(() => {
|
||||
ctx.$`aplay ${soundPath}`.catch(() => {})
|
||||
ctx.$`paplay ${soundPath} 2>/dev/null`.catch(() => {
|
||||
ctx.$`aplay ${soundPath} 2>/dev/null`.catch(() => {})
|
||||
})
|
||||
break
|
||||
case "win32":
|
||||
|
||||
Reference in New Issue
Block a user