fix(mail): use visible banner for tmux notifications

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 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-19 12:00:22 -08:00
parent 95ba8fcb6b
commit d371f60e03
2 changed files with 19 additions and 4 deletions

View File

@@ -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.

View File

@@ -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}"