tmux-control
Installation
SKILL.md
tmux Control Patterns
Reliable patterns for programmatic tmux interaction. The #1 source of bugs is targeting — follow these rules strictly.
Golden Rules
- Use unique IDs for targeting:
%N(pane),@N(window),$NAME(session) — never bare indexes - Use
wait-forinstead ofsleepfor synchronization - Pass commands to
new-window/split-windowdirectly — avoid send-keys to freshly created panes (race condition) - Always use
-d(detached) withnew-windowandsplit-window— never steal focus from the user's active window - Verify targets exist before sending — use
list-panes -ato check panes,list-windowsfor windows,has-sessionfor sessions - Use full binary paths in commands sent to panes — the pane's environment may differ from yours
Targeting
The format is SESSION:WINDOW.PANE. All three parts are optional but be explicit.