Add clickable mail preview in tmux status bar

- New `gt mail peek` command shows compact preview of first unread message
- Left-click on status-right (mail icon area) opens popup with mail preview
- Popup shows subject, sender, body preview (truncated to 500 chars)
- Shows count of additional unread messages if any
- Silent exit (code 1) when no unread mail

🤖 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-21 23:14:08 -08:00
parent 258c5de81a
commit caeba65000
2 changed files with 86 additions and 0 deletions

View File

@@ -498,5 +498,18 @@ func (t *Tmux) ConfigureGasTownSession(session string, theme Theme, rig, worker,
if err := t.SetDynamicStatus(session); err != nil {
return fmt.Errorf("setting dynamic status: %w", err)
}
if err := t.SetMailClickBinding(session); err != nil {
return fmt.Errorf("setting mail click binding: %w", err)
}
return nil
}
// SetMailClickBinding configures left-click on status-right to show mail preview.
// This creates a popup showing the first unread message when clicking the mail icon area.
func (t *Tmux) SetMailClickBinding(session string) error {
// Bind left-click on status-right to show mail popup
// The popup runs gt mail peek and closes on any key
_, err := t.run("bind-key", "-T", "root", "MouseDown1StatusRight",
"display-popup", "-E", "-w", "60", "-h", "15", "gt mail peek || echo 'No unread mail'")
return err
}