From bb092d71f76106c38d0fd9393d8b35dec8c25a11 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Thu, 25 Dec 2025 14:51:38 -0800 Subject: [PATCH] Revert "feat(crew): cycle across all rigs with C-b n/p" This reverts commit 601f8ab4d33e681ac21d884a402ba0efb6d90316. --- internal/cmd/crew_cycle.go | 12 ++++++------ internal/cmd/crew_helpers.go | 25 ------------------------- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/internal/cmd/crew_cycle.go b/internal/cmd/crew_cycle.go index 9e1c2125..970e1bcb 100644 --- a/internal/cmd/crew_cycle.go +++ b/internal/cmd/crew_cycle.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" ) -// cycleCrewSession switches to the next or previous crew session across ALL rigs. +// cycleCrewSession switches to the next or previous crew session in the same rig. // 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") } - // Verify we're in a crew session - _, _, ok := parseCrewSessionName(currentSession) + // Parse rig name from current session + rigName, _, ok := parseCrewSessionName(currentSession) if !ok { return fmt.Errorf("not in a crew session (expected gt--crew-)") } - // Find all crew sessions across all rigs - sessions, err := findAllCrewSessions() + // Find all crew sessions for this rig + sessions, err := findRigCrewSessions(rigName) if err != nil { return fmt.Errorf("listing sessions: %w", err) } if len(sessions) == 0 { - return fmt.Errorf("no crew sessions found") + return fmt.Errorf("no crew sessions found for rig %s", rigName) } // Sort for consistent ordering diff --git a/internal/cmd/crew_helpers.go b/internal/cmd/crew_helpers.go index 38ac88f4..11f9f4bb 100644 --- a/internal/cmd/crew_helpers.go +++ b/internal/cmd/crew_helpers.go @@ -294,28 +294,3 @@ func findRigCrewSessions(rigName string) ([]string, error) { // (alphabetical by session name means alphabetical by crew name) return sessions, nil } - -// findAllCrewSessions returns all crew sessions across all rigs, sorted alphabetically. -// Uses tmux list-sessions to find sessions matching gt-*-crew-* pattern. -func findAllCrewSessions() ([]string, error) { - cmd := exec.Command("tmux", "list-sessions", "-F", "#{session_name}") - out, err := cmd.Output() - if err != nil { - // No tmux server or no sessions - return nil, nil - } - - var sessions []string - - for _, line := range strings.Split(strings.TrimSpace(string(out)), "\n") { - if line == "" { - continue - } - // Match gt--crew- pattern - if strings.HasPrefix(line, "gt-") && strings.Contains(line, "-crew-") { - sessions = append(sessions, line) - } - } - - return sessions, nil -}