From f972c69f3a598f3a4fd70c85e5cc059b0dadd463 Mon Sep 17 00:00:00 2001 From: nux Date: Sat, 3 Jan 2026 13:10:58 -0800 Subject: [PATCH] fix: increase SendKeys debounce to 500ms for reliable Enter key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tmux send-keys Enter key was unreliable because SendKeys used only 100ms debounce while NudgeSession (known to work) uses 500ms. Root cause: When agents start other agents or inject startup commands, they use SendKeys() which had only 100ms debounce. This is insufficient for Claude Code to process the paste before Enter arrives. The fix increases DefaultDebounceMs from 100ms to 500ms, making all SendKeys calls as reliable as NudgeSession calls. Fixes: hq-y9id 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/constants/constants.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/constants/constants.go b/internal/constants/constants.go index 85d99186..8bfec318 100644 --- a/internal/constants/constants.go +++ b/internal/constants/constants.go @@ -17,7 +17,9 @@ const ( ShellReadyTimeout = 5 * time.Second // DefaultDebounceMs is the default debounce for SendKeys operations. - DefaultDebounceMs = 100 + // 500ms is required for Claude Code to reliably process paste before Enter. + // See NudgeSession comment: "Wait 500ms for paste to complete (tested, required)" + DefaultDebounceMs = 500 // DefaultDisplayMs is the default duration for tmux display-message. DefaultDisplayMs = 5000