From 6b0d03f2d632597a75e63d03a9932d189d354a2b Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Tue, 3 Mar 2026 14:26:06 +0300 Subject: Fix: decompres before notify --- session.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'session.go') diff --git a/session.go b/session.go index 5784333..42d5001 100644 --- a/session.go +++ b/session.go @@ -170,6 +170,17 @@ func copyToClipboard(text string) error { } func notifyUser(topic, message string) error { - cmd := exec.Command("notify-send", topic, message) + // Sanitize message to remove control characters that notify-send doesn't handle + sanitized := strings.Map(func(r rune) rune { + if r < 32 && r != '\t' { + return -1 + } + return r + }, message) + // Truncate if too long + if len(sanitized) > 200 { + sanitized = sanitized[:197] + "..." + } + cmd := exec.Command("notify-send", topic, sanitized) return cmd.Run() } -- cgit v1.2.3