diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-03-03 14:26:06 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-03-03 14:26:06 +0300 |
| commit | 6b0d03f2d632597a75e63d03a9932d189d354a2b (patch) | |
| tree | c5c5509e49395b5a571b5c7be38f8077abac7456 /session.go | |
| parent | fb4deb1161cca50d1affea850f842c7683647ecd (diff) | |
Fix: decompres before notify
Diffstat (limited to 'session.go')
| -rw-r--r-- | session.go | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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() } |
