feat(crew): cycle across all rigs with C-b n/p

Previously C-b n and C-b p only cycled between crew sessions in the
same rig. Now they cycle across ALL crew sessions regardless of rig.

This enables quick switching between gastown/joe and beads/emma with
a single keystroke.

🤖 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-25 14:50:05 -08:00
parent 413eaef5a8
commit 601f8ab4d3
2 changed files with 31 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/spf13/cobra"
)
// cycleCrewSession switches to the next or previous crew session in the same rig.
// cycleCrewSession switches to the next or previous crew session across ALL rigs.
// direction: 1 for next, -1 for previous
func cycleCrewSession(direction int) error {
// Get current session (uses existing function from handoff.go)
@@ -20,20 +20,20 @@ func cycleCrewSession(direction int) error {
return fmt.Errorf("not in a tmux session")
}
// Parse rig name from current session
rigName, _, ok := parseCrewSessionName(currentSession)
// Verify we're in a crew session
_, _, ok := parseCrewSessionName(currentSession)
if !ok {
return fmt.Errorf("not in a crew session (expected gt-<rig>-crew-<name>)")
}
// Find all crew sessions for this rig
sessions, err := findRigCrewSessions(rigName)
// Find all crew sessions across all rigs
sessions, err := findAllCrewSessions()
if err != nil {
return fmt.Errorf("listing sessions: %w", err)
}
if len(sessions) == 0 {
return fmt.Errorf("no crew sessions found for rig %s", rigName)
return fmt.Errorf("no crew sessions found")
}
// Sort for consistent ordering