fix: add sleep before Enter send to fix auto-submit on older WezTerm#160
Merged
bfly123 merged 1 commit intobfly123:mainfrom Mar 31, 2026
Merged
Conversation
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 bfly123#149 and was inadvertently dropped in bfly123#151. Fixes: bfly123#149 regression introduced by bfly123#151 on older WezTerm versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
send-key(e.g.20240203-110809-5046fc22) fall through to the CR byte fallback insend_via_wezterm()immediately aftersend-textcompletes\rarrives before the TUI has finished processing the bracketed paste sequence — Claude Code ignores it and requires a manual Entertime.sleep(0.1)before any Enter-sending attempt, so the bracketed paste is fully consumed firstThis reproduces the timing that was present in #149 and was inadvertently dropped in #151.
Root cause
_send_wezterm_enter()tries 6send-keyvariants that all fail instantly on older WezTerm (unrecognized subcommand). The fallback\ris then sent with no delay — too fast for the TUI's paste handler.Test plan
20240203(nosend-key): completion hook response auto-submits without manual Entersend-key):_send_wezterm_enter()succeeds as before, sleep is a no-op overheadRelated: #149, #151