Add town session cycling for mayor/deacon (C-b n/p)

- Create gt town next/prev commands for cycling between town-level sessions
- Add SetTownCycleBindings() to tmux package
- Wire up bindings when starting mayor and deacon sessions

Now mayor and deacon have the same C-b n/p cycling behavior as crew workers.

🤖 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-28 16:00:28 -08:00
parent 213b3bab20
commit faee888a9f
4 changed files with 186 additions and 0 deletions

View File

@@ -674,6 +674,23 @@ func (t *Tmux) SetCrewCycleBindings(session string) error {
return nil
}
// SetTownCycleBindings sets up C-b n/p to cycle through town-level sessions.
// Town-level sessions are Mayor and Deacon - the global coordinators.
// This allows quick switching between them without using the session picker.
func (t *Tmux) SetTownCycleBindings(session string) error {
// C-b n → gt town next (switch to next town session)
if _, err := t.run("bind-key", "-T", "prefix", "n",
"run-shell", "gt town next --session '#{session_name}'"); err != nil {
return err
}
// C-b p → gt town prev (switch to previous town session)
if _, err := t.run("bind-key", "-T", "prefix", "p",
"run-shell", "gt town prev --session '#{session_name}'"); err != nil {
return err
}
return nil
}
// SetFeedBinding configures C-b a to jump to the activity feed window.
// This creates the feed window if it doesn't exist, or switches to it if it does.
// Uses `gt feed --window` which handles both creation and switching.