From 089d03453da1e643e1703aa846ac1cc3b44ff1e7 Mon Sep 17 00:00:00 2001 From: Wangnov <48670012+Wangnov@users.noreply.github.com> Date: Wed, 4 Feb 2026 14:03:47 +0800 Subject: [PATCH] docs(skills): split tmux send-keys for TUI (#7737) * docs(skills): split tmux send-keys for TUI * docs(skills): soften TUI send-keys wording --------- Co-authored-by: wangnov <1694546283@qq.com> --- skills/tmux/SKILL.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/skills/tmux/SKILL.md b/skills/tmux/SKILL.md index 5ca95cd898..6502959666 100644 --- a/skills/tmux/SKILL.md +++ b/skills/tmux/SKILL.md @@ -50,6 +50,15 @@ To monitor: - Prefer literal sends: `tmux -S "$SOCKET" send-keys -t target -l -- "$cmd"`. - Control keys: `tmux -S "$SOCKET" send-keys -t target C-c`. +- For interactive TUI apps like Claude Code/Codex, this guidance covers **how to send commands**. + Do **not** append `Enter` in the same `send-keys`. These apps may treat a fast text+Enter + sequence as paste/multi-line input and not submit; this is timing-dependent. Send text and + `Enter` as separate commands with a small delay (tune per environment; increase if needed, + or use `sleep 1` if sub-second sleeps aren't supported): + +```bash +tmux -S "$SOCKET" send-keys -t target -l -- "$cmd" && sleep 0.1 && tmux -S "$SOCKET" send-keys -t target Enter +``` ## Watching output @@ -82,6 +91,9 @@ done tmux -S "$SOCKET" send-keys -t agent-1 "cd /tmp/project1 && codex --yolo 'Fix bug X'" Enter tmux -S "$SOCKET" send-keys -t agent-2 "cd /tmp/project2 && codex --yolo 'Fix bug Y'" Enter +# When sending prompts to Claude Code/Codex TUI, split text + Enter with a delay +tmux -S "$SOCKET" send-keys -t agent-1 -l -- "Please make a small edit to README.md." && sleep 0.1 && tmux -S "$SOCKET" send-keys -t agent-1 Enter + # Poll for completion (check if prompt returned) for sess in agent-1 agent-2; do if tmux -S "$SOCKET" capture-pane -p -t "$sess" -S -3 | grep -q "❯"; then