From testing
This skill should be used proactively whenever Claude needs to interact with, test, validate, verify, or observe a terminal user interface (TUI). This includes after writing TUI code and wanting to confirm it works, when debugging TUI behavior, when asked to verify UI changes, when running end-to-end validation of a TUI application, or any time Claude determines that launching and driving a TUI programmatically would help complete the task. Do not wait for the user to ask — use this skill autonomously whenever TUI interaction would validate work or answer questions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/testing:tui-testingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Programmatically launch, interact with, and validate terminal user interface applications using tmux as a headless terminal driver.
Programmatically launch, interact with, and validate terminal user interface applications using tmux as a headless terminal driver.
tmux provides a real PTY with proper dimensions, a rendered screen buffer readable via capture-pane, and keystroke injection via send-keys. The TUI app sees a real terminal and behaves identically to interactive use. No modifications to the application are required.
which tmux || sudo apt-get install -y tmux
Start a named, detached tmux session with explicit dimensions and run the TUI inside it:
tmux new-session -d -s <session-name> -x 120 -y 30 '<command to start TUI>'
-d detaches immediately (headless)-s names the session for later reference-x/-y set terminal width/height so the TUI renders predictablyWait briefly for the TUI to initialize before sending keys:
sleep 2
Capture the current visible contents of the terminal:
tmux capture-pane -t <session-name> -p
This returns plain text exactly as a human would see it, with ANSI escape sequences stripped. To include color/style info, add -e.
To capture specific line ranges (0-indexed):
tmux capture-pane -t <session-name> -p -S 0 -E 10
Send keys to the TUI session:
# Navigation keys
tmux send-keys -t <session-name> Down
tmux send-keys -t <session-name> Up
tmux send-keys -t <session-name> Enter
tmux send-keys -t <session-name> Tab
tmux send-keys -t <session-name> Escape
# Letter keys (for TUI hotkeys like j/k/q)
tmux send-keys -t <session-name> j
tmux send-keys -t <session-name> q
# Ctrl combinations
tmux send-keys -t <session-name> C-c
tmux send-keys -t <session-name> C-q
# Type literal text (not interpreted as key names)
tmux send-keys -t <session-name> -l 'some text'
Important: After sending keys, wait for the TUI to re-render before capturing:
tmux send-keys -t <session-name> j && sleep 0.5 && tmux capture-pane -t <session-name> -p
When waiting for async operations (loading screens, background tasks):
for i in $(seq 1 30); do
output=$(tmux capture-pane -t <session-name> -p)
if echo "$output" | grep -q "expected text"; then
echo "Found it"
break
fi
sleep 0.5
done
tmux kill-session -t <session-name>
The general pattern for any TUI interaction is:
Always read the screen before and after actions. Do not blindly send sequences of keys without verifying intermediate state.
tmux send-keys Enter sends the Enter key. To type the literal word "Enter", use tmux send-keys -l 'Enter'.-x and -y.docker exec to interact with the inner session.capture-pane handles this correctly.tmux resize-window -t <session-name> -x <w> -y <h>.npx claudepluginhub benjaminbenetti/bb-claude-plugins --plugin testingAutomates interactive terminal programs (REPLs, debuggers, TUIs) via PTY. Start sessions, type text/keystrokes, wait for screen stability, snapshot output, and manage multiple sessions.
Provides design patterns for terminal user interfaces: layout paradigms, keyboard navigation, visual systems, and TUI anti-pattern validation. Works with Ratatui, Ink, Textual, Bubbletea, or any TUI framework.
Debug interactive CLIs, REPLs, TUIs, watchers, and long-running terminal processes using tmux to preserve live state, send controlled input, and capture evidence. Use when commands hang, wait for input, or behave differently in a real terminal.