tmux-terminal
tmux-terminal
Overview
Use tmux to drive interactive terminal sessions, including TUI workflows like ralph-tui. tmux lets you send keystrokes, capture screen output, and keep processes running between steps.
When to Use
- Testing
ralph-tuior any interactive CLI prompts - Managing long-running processes (web server, loops, watch mode)
- Capturing live terminal output for QA reports
- Interacting with applications that redraw the screen
Prerequisites
tmuxinstalled (pre-installed on macOS)
Verify:
tmux -V
Core Commands
Create a detached session:
tmux new-session -d -s <name>
Send commands (append Enter to execute):
tmux send-keys -t <name> "<command>" Enter
Capture screen output:
tmux capture-pane -t <name> -p
Kill session when done:
tmux kill-session -t <name>
Special Keys
Use send-keys with key names:
EnterC-c(Ctrl-C)C-d(Ctrl-D)TabEscapeUp,Down,Left,Right
Examples:
tmux send-keys -t <name> Up
tmux send-keys -t <name> C-c
TUI Interaction Patterns
Start ralph-tui
tmux new-session -d -s ralph-tui
tmux send-keys -t ralph-tui "cargo run -p ralph-tui" Enter
Navigate in TUI
tmux send-keys -t ralph-tui Down
tmux send-keys -t ralph-tui Enter
Capture and parse the screen
tmux capture-pane -t ralph-tui -p -S -200
Use -S -200 to capture the last 200 lines when the screen is noisy.
Long-Running Process Management
- Start servers or loops in a tmux session to keep them alive.
- Use
capture-paneto confirm health (look for "listening" or "ready" text). - Stop cleanly with
C-cthenkill-session.
Example:
tmux new-session -d -s ralph-web
tmux send-keys -t ralph-web "cargo run -p ralph-cli -- web" Enter
tmux capture-pane -t ralph-web -p | rg -n "listening|ready"
tmux send-keys -t ralph-web C-c
tmux kill-session -t ralph-web
Notes
- Keep session names short and unique.
- Always clean up sessions to avoid leaking background processes.
- If output looks empty, wait briefly and capture again.
More from mikeyobrien/ralph-orchestrator
ralph-loop
Run, monitor, resume, merge, and debug Ralph loops. Use this skill whenever the user asks to operate `ralph run` or `ralph loops`, inspect loop state, recover suspended loops, analyze diagnostics, or unblock merge queue issues.
80pdd
Transforms a rough idea into a detailed design document with implementation plan. Follows Prompt-Driven Development — iterative requirements clarification, research, design, and planning.
52tui-validate
Validates Terminal User Interface (TUI) output using freeze for screenshot capture and LLM-as-judge for semantic validation. Supports both visual (PNG/SVG) and text-based validation modes.
44code-assist
Guides implementation of code tasks using test-driven development in an Explore, Plan, Code, Commit workflow. Acts as a Technical Implementation Partner and TDD Coach — following existing patterns, avoiding over-engineering, and producing idiomatic, modern code.
41ralph-hats
Create, inspect, validate, explain, and improve Ralph hat collections. Use this skill whenever the user asks to make or refine a `.ralph/hats/*.yml` workflow, debug hat routing, explain event topology, or tune a multi-hat Ralph run.
41code-task-generator
Generates structured .code-task.md files from descriptions or PDD implementation plans. Auto-detects input type, creates properly formatted tasks with Given-When-Then acceptance criteria.
37