INNER CODE UNIT · Python

tmux_send

Dicklesworthstone/claude_code_agent_farm · claude_code_agent_farm.py:133

def tmux_send(target: str, data: str, enter: bool = True, update_heartbeat: bool = True) -> None:
    """Send keystrokes to a tmux pane (binary-safe)"""
    max_retries = 3
    base_delay = 0.5

    for attempt in range(max_retries):
        try:
            if data:
                # Use tmux buffer API for robustness with large payloads
                # Create a temporary file with the data to avoid shell-quoting issues
                import os
                import tempfile
                import uuid

                with tempfile.NamedTemporaryFile("w", delete=False, encoding="utf-8") as tmp:
                    tmp.write(data)
                    tmp_path = tmp.name

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…