Clear tmux scrollback on handoff

Adds ClearHistory method to tmux package and calls it before
respawn-pane during handoff. This resets copy-mode display
from [0/N] to [0/0] for a clean session start.

🤖 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-25 02:07:23 -08:00
parent 62402bd4bd
commit 818a8a41f9
2 changed files with 22 additions and 0 deletions

View File

@@ -582,6 +582,14 @@ func (t *Tmux) RespawnPane(pane, command string) error {
return err
}
// ClearHistory clears the scrollback history buffer for a pane.
// This resets copy-mode display from [0/N] to [0/0].
// The pane parameter should be a pane ID (e.g., "%0") or session:window.pane format.
func (t *Tmux) ClearHistory(pane string) error {
_, err := t.run("clear-history", "-t", pane)
return err
}
// SwitchClient switches the current tmux client to a different session.
// Used after remote recycle to move the user's view to the recycled session.
func (t *Tmux) SwitchClient(targetSession string) error {