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:
@@ -294,3 +294,28 @@ 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-<rig>-crew-<name> pattern
|
||||
if strings.HasPrefix(line, "gt-") && strings.Contains(line, "-crew-") {
|
||||
sessions = append(sessions, line)
|
||||
}
|
||||
}
|
||||
|
||||
return sessions, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user