From 151ebbf407539fc740856f68c7c1b4092df0bb5d Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 15 Dec 2025 21:13:18 +0900 Subject: [PATCH] Suppress stderr output from Linux notification commands to fix WSL errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- src/hooks/session-notification.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hooks/session-notification.ts b/src/hooks/session-notification.ts index af638ec..21b9732 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}`.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":