Fix: decompres before notify

This commit is contained in:
Grail Finder
2026-03-03 14:26:06 +03:00
parent fb4deb1161
commit 6b0d03f2d6
2 changed files with 24 additions and 1 deletions

View File

@@ -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()
}