Skip to content

fix: prevent Claude prompts from getting stranded before Enter - #532

Merged
Juliusolsson05 merged 1 commit into
mainfrom
fix/claude-2-1-209-enter
Jul 14, 2026
Merged

Juliusolsson05 merged 1 commit into
mainfrom
fix/claude-2-1-209-enter

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

What changed

  • removes Claude's unsafe short-prompt prompt + CR atomic PTY write;
  • writes prompt bytes first for every text submission;
  • waits until the prompt tail or collapsed-paste placeholder is visible in the active Claude composer;
  • sends Enter only after that observable absorption boundary;
  • keeps durable user/queue JSONL acceptance as the final success condition;
  • allows even one-character prompts to use the shared absorption detector.

Why

Claude Code 2.1.209 can leave text visibly inserted in a long-lived PTY composer while swallowing the Enter coalesced into the same write. Paste journals showed repeated 20-second acceptance timeouts after prompt-and-enter-written, with the prompt still editable on screen.

Fresh PTY probes confirmed CR/LF remain valid key bytes, including while busy. The broken invariant was relying on an atomic text+Enter write without first proving that Claude had processed the text.

Verification

  • real Electron/node-pty probes against Claude Code 2.1.209;
  • idle CR/LF and bracketed-paste matrix;
  • busy-session queue probe;
  • 18 focused delivery and durable-acceptance tests pass.

Closes #531

@Juliusolsson05
Juliusolsson05 merged commit be01c2c into main Jul 14, 2026
@Juliusolsson05
Juliusolsson05 deleted the fix/claude-2-1-209-enter branch July 14, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude 2.1.209: prompt reaches PTY composer but Enter is swallowed

1 participant