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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user