Crew sessions: use respawn-pane for cleaner lifecycle (gt-09i4)

Replace SendKeys approach with respawn-pane -k when starting Claude
in crew sessions. This gives cleaner exit behavior:
- Before: Claude exits → shell prompt → exit shell → session ends
- After: Claude exits → session ends (no intermediate shell)

Changes:
- Add GetPaneID() to tmux package for pane ID retrieval
- Update crew_at.go to use RespawnPane for both new and restart cases
- Remove unnecessary waits and multi-step Claude startup

🤖 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-26 13:20:24 -08:00
parent e8a50e5cbf
commit 36eb38be82
2 changed files with 37 additions and 36 deletions

View File

@@ -236,6 +236,20 @@ func (t *Tmux) GetPaneCommand(session string) (string, error) {
return strings.TrimSpace(out), nil
}
// GetPaneID returns the pane identifier for a session's first pane.
// Returns a pane ID like "%0" that can be used with RespawnPane.
func (t *Tmux) GetPaneID(session string) (string, error) {
out, err := t.run("list-panes", "-t", session, "-F", "#{pane_id}")
if err != nil {
return "", err
}
lines := strings.Split(out, "\n")
if len(lines) == 0 || lines[0] == "" {
return "", fmt.Errorf("no panes found in session %s", session)
}
return lines[0], nil
}
// GetPaneWorkDir returns the current working directory of a pane.
func (t *Tmux) GetPaneWorkDir(session string) (string, error) {
out, err := t.run("list-panes", "-t", session, "-F", "#{pane_current_path}")