Repository navigation
fix: deliver shift+enter's esc cr as one write - #182
Merged
Merged
Conversation
scode
force-pushed
the
pr/create-default-install
branch
from
August 19, 2026 14:45
8579319 to
8fdf796
Compare
scode
force-pushed
the
pr/shift-enter-single-write
branch
from
August 19, 2026 14:45
e1ba71f to
b90bf7c
Compare
The chord had two producers: the keydown handler sent the ESC and xterm's own Enter path sent the CR, one websocket message apart — and a message this small is one send-keys command and one pty write (measured on the pinned tmux 3.7b: two commands land as two reads ~7ms apart, never coalesced). Line editors that disambiguate a lone ESC by read boundary saw Escape then Enter: Codex submitted the prompt instead of inserting a newline (openai/codex#21699 shows the same symptom in tmux, though its own diagnosis is extended-key negotiation rather than write splitting), and a zsh with vi-mode's KEYTIMEOUT=1 sits on the same edge. bash's 500ms readline timeout papered over the split, which is why it shipped. The keydown now arms a merge instead of sending, and the onData wrapper glues the ESC onto the \r xterm emits synchronously for that same keystroke — one message, one write, with xterm's Enter-path side effects kept intact. The arm lives exactly one keydown dispatch (a microtask queued at arm time expires it), so a chord whose \r never materializes leaves no stale arm to prefix a later unrelated Enter, and the ESC is never flushed alone. Verified in a scratch tmux 3.7b that single-write ESC CR inserts a real line break in codex-cli 0.147.0 and Claude Code 2.1.235, so one sequence serves every pane and no per-target branching is needed.
scode
force-pushed
the
pr/shift-enter-single-write
branch
from
August 19, 2026 14:59
b90bf7c to
b76652c
Compare
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.
No description provided.