From 90a78ea8ed153d0e55438682d325bbe8575bd72e Mon Sep 17 00:00:00 2001 From: Natalie Date: Tue, 2 Jun 2026 15:20:29 -0700 Subject: [PATCH] =?UTF-8?q?fix(@scripts/session-tools):=20=F0=9F=90=9B=20a?= =?UTF-8?q?dd=20delay=20for=20paste=20submission?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- bin/rclaude | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/rclaude b/bin/rclaude index 41991be..ab9f3e0 100755 --- a/bin/rclaude +++ b/bin/rclaude @@ -829,6 +829,15 @@ cmd_list() { # a leading `/` is just text — easy to accidentally turn a slash # command into prose. # +# Multi-line / long payloads arrive as a bracketed paste: Claude's TUI buffers +# them as a "[Pasted text]" block that needs an explicit submit. A trailing +# Enter sent immediately after the literal text is swallowed into the paste +# (treated as a newline, not a submit), so the turn silently never submits — +# the input just accumulates across sends. A short pause before Enter lets the +# paste settle so the Enter registers as a submit. Single-line sends (e.g. the +# orchestrator cold-start kick) were unaffected, which is why this only bit +# long turns like the rounds prompt. +# # Concurrent sends to the same pane can still race the input buffer. Callers # that need ordering should serialize externally (flock on a per-pane lock). cmd_send() { @@ -926,7 +935,7 @@ EOF if is_local "$_host"; then if tmux send-keys -t "$_sess" C-a C-k 2>/dev/null \ && tmux send-keys -t "$_sess" -l -- "$_text" 2>/dev/null \ - && tmux send-keys -t "$_sess" Enter 2>/dev/null; then + && { sleep 0.5; tmux send-keys -t "$_sess" Enter 2>/dev/null; }; then : else _failed=$((_failed + 1)) @@ -935,7 +944,7 @@ EOF else _q_sess=$(sh_quote "$_sess") if ssh -o BatchMode=yes -o ConnectTimeout=3 "$_host" \ - "tmux send-keys -t $_q_sess C-a C-k && tmux send-keys -t $_q_sess -l -- $_quoted_text && tmux send-keys -t $_q_sess Enter" \ + "tmux send-keys -t $_q_sess C-a C-k && tmux send-keys -t $_q_sess -l -- $_quoted_text && sleep 0.5 && tmux send-keys -t $_q_sess Enter" \ /dev/null 2>&1; then : else