From d371f60e036c628588a93570de183afd67a1f4bf Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Fri, 19 Dec 2025 12:00:22 -0800 Subject: [PATCH] fix(mail): use visible banner for tmux notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace tmux display-message (subtle status bar notification) with send-keys to echo a visible banner to the terminal. This ensures mail notifications are actually seen by agents. Closes gt-vnp9 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/mail/router.go | 7 +++---- internal/tmux/tmux.go | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/internal/mail/router.go b/internal/mail/router.go index 0669b4b4..dfb7909c 100644 --- a/internal/mail/router.go +++ b/internal/mail/router.go @@ -83,7 +83,7 @@ func (r *Router) GetMailbox(address string) (*Mailbox, error) { } // notifyRecipient sends a notification to a recipient's tmux session. -// Uses display-message for non-disruptive notification. +// Uses send-keys to echo a visible banner to ensure notification is seen. // Supports mayor/, rig/polecat, and rig/refinery addresses. func (r *Router) notifyRecipient(msg *Message) error { sessionID := addressToSessionID(msg.To) @@ -97,9 +97,8 @@ func (r *Router) notifyRecipient(msg *Message) error { return nil // No active session, skip notification } - // Display notification in status line (non-disruptive) - notification := fmt.Sprintf("[MAIL] From %s: %s", msg.From, msg.Subject) - return r.tmux.DisplayMessageDefault(sessionID, notification) + // Send visible notification banner to the terminal + return r.tmux.SendNotificationBanner(sessionID, msg.From, msg.Subject) } // addressToSessionID converts a mail address to a tmux session ID. diff --git a/internal/tmux/tmux.go b/internal/tmux/tmux.go index a303bbf1..dafae159 100644 --- a/internal/tmux/tmux.go +++ b/internal/tmux/tmux.go @@ -227,6 +227,22 @@ func (t *Tmux) DisplayMessageDefault(session, message string) error { return t.DisplayMessage(session, message, 5000) } +// SendNotificationBanner sends a visible notification banner to a tmux session. +// This interrupts the terminal to ensure the notification is seen. +// Uses echo to print a boxed banner with the notification details. +func (t *Tmux) SendNotificationBanner(session, from, subject string) error { + // Build the banner text + banner := fmt.Sprintf(`echo ' +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📬 NEW MAIL from %s +Subject: %s +Run: bd mail inbox +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +'`, from, subject) + + return t.SendKeys(session, banner) +} + // GetSessionInfo returns detailed information about a session. func (t *Tmux) GetSessionInfo(name string) (*SessionInfo, error) { format := "#{session_name}|#{session_windows}|#{session_created_string}|#{session_attached}"