Repository navigation
fix(terminal): keep other input out of large bracketed pastes - #42948
Merged
juliusmarminge merged 13 commits intoNov 25, 2026
Merged
Conversation
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.
Typing from another client could insert characters into a large paste in a shared terminal. Web, desktop, and mobile now mark split writes so the server holds competing input until a paste finishes or is interrupted. Mobile also keeps keystrokes behind pastes already in its local queue.
Related: #37937, #36352
Reproduction on main
Commit b61af8a5d2 (main), in the running web app:
The word typed in the second window appears in the middle of the pasted letters. Expected: The pasted letters appear as one uninterrupted block, and the word typed in the second window is not mixed into them.
The cause is at
apps/server/src/terminal/Manager.ts:3895. Ranpnpm scenarios:prove scripts/scenarios/terminal-paste-keeps-input-from-other-client-out.e2e.ts --target webwith the repro scenario added: it failed in 2 of 2 runs on a clean checkout, withexpected "Other input landed inside the paste" to be "Paste arrived intact"in the output.Evidence
Environment: The web app in Chromium on Linux x64, a fresh checkout.
Proven: the repro fails at the test commit 4e16da56ff and passes on the head 64c53ece33, both on main a76e554784.
Before the fix, recorded:
https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/bb4792e8-bd86-49f5-94ab-b1d025049ed8/before-recording.webm
After the fix, recorded:
https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/ae3d0f90-a297-405c-a050-394a65be6890/after-recording.webm
Outside view: a person sees it in the running web app by following the steps under Reproduction on main.
Tests
pnpm exec vp run check:changed a76e5547844b11688454f8f41095597d196eccfepassed on head.Not in this change
Who did the work
Made in T3 Code by GPT 6.2 Sol, Claude Opus 5.5, Grok 4.7 and Gemini 4 Neon