fix: gt crew at restarts Claude if it has exited

- Check pane_current_command to detect if Claude is still running
- If shell is detected (bash, zsh, etc.), Claude exited - restart it
- Re-prime after restart with gt prime

🤖 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-17 20:10:05 -08:00
parent 3b1ce3afe1
commit c4b942b7e9
2 changed files with 35 additions and 0 deletions

View File

@@ -133,6 +133,16 @@ func (t *Tmux) SendKeysDelayed(session, keys string, delayMs int) error {
return t.SendKeys(session, keys)
}
// GetPaneCommand returns the current command running in a pane.
// Returns "bash", "zsh", "claude", "node", etc.
func (t *Tmux) GetPaneCommand(session string) (string, error) {
out, err := t.run("list-panes", "-t", session, "-F", "#{pane_current_command}")
if err != nil {
return "", err
}
return strings.TrimSpace(out), nil
}
// CapturePane captures the visible content of a pane.
func (t *Tmux) CapturePane(session string, lines int) (string, error) {
return t.run("capture-pane", "-p", "-t", session, "-S", fmt.Sprintf("-%d", lines))