INNER CODE UNIT · Python

tmux_capture

Dicklesworthstone/claude_code_agent_farm · claude_code_agent_farm.py:191

def tmux_capture(target: str) -> str:
    """Capture content from a tmux pane"""
    max_retries = 3

    for attempt in range(max_retries):
        try:
            _, stdout, _ = run(f"tmux capture-pane -t {target} -p", quiet=True, capture=True)
            return stdout
        except subprocess.CalledProcessError:
            if attempt < max_retries - 1:
                time.sleep(0.2)
            else:
                # Return empty string on persistent failure
                return ""
    return ""


# ─────────────────────────────── Agent Monitor ────────────────────────────── #

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…