From 1dafed9ff5f05c2ed1c3c44e19c79663c267c9c8 Mon Sep 17 00:00:00 2001 From: Mustapha Date: Mon, 30 Mar 2026 13:02:29 +0100 Subject: [PATCH] fix: add sleep before Enter send to fix auto-submit on older WezTerm WezTerm builds pre-dating send-key (e.g. 20240203) fall through to the CR byte fallback immediately after send-text completes. Without a short delay, the \r arrives before the TUI has finished processing the bracketed paste sequence, causing Claude Code to ignore it and require a manual Enter. Add time.sleep(0.1) before any Enter-sending attempt so the bracketed paste is fully consumed first. Reproduces the timing that was present in #149 and was inadvertently dropped in #151. Fixes: #149 regression introduced by #151 on older WezTerm versions. --- bin/ccb-completion-hook | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/ccb-completion-hook b/bin/ccb-completion-hook index 3d3bdeb0..a5195f67 100755 --- a/bin/ccb-completion-hook +++ b/bin/ccb-completion-hook @@ -227,6 +227,7 @@ def send_via_wezterm(pane_id: str, message: str, session_data: dict) -> bool: ) _debug_log(f"wezterm send-text pane={pane_id!r} rc={result.returncode}") if result.returncode == 0: + time.sleep(0.1) # Give TUI time to process bracketed paste before Enter if _send_wezterm_enter(base_args, pane_id): _debug_log(f"wezterm submit via send-key pane={pane_id!r} rc=0") return True