Repository navigation
fix: preserve unframed multiline terminal paste chunks - #268
Merged
Merged
Conversation
Closed
2 tasks done
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.
Change
Related to #265. When a terminal delivers an unframed multiline text chunk,
StdinBuffersplits its CR bytes into Enter key events. Replaying three CR/CRLF-separated lines throughProcessTerminaland the product Editor reproduced three unintended submissions before this change.Route plain-text chunks containing an internal line ending through the existing paste event before key splitting. The editor then normalizes line endings and tabs and preserves large-paste folding. Bracketed paste, standalone Enter, text followed only by a final Enter, and control sequences keep their existing paths. No timing heuristic or third-party source change is introduced.
This is a bounded fallback: unframed input split into line-sized or character-sized chunks remains indistinguishable from typing. Conversely, multiple typed lines coalesced into one chunk are treated as a paste. The issue does not identify the host terminal or include raw input bytes, so the reporter's exact WSL cause remains unconfirmed. The issue should remain open for host-terminal confirmation.
Validation
pnpm verify, full profile on clean commitcd9fbe785cab6d033d70615eb6d8fbcf253e0f46, macOS arm64 / Node 26.4.0 (14 applicable gates).dist/cli.jsin macOS PTYs, regular and fullscreen modes: unframed CRLF multiline draft, fragmented bracketed paste,/helpsubmitted with ordinary Enter, and paste-mode enable/disable output. xterm-headless readback verified draft lines and the resulting Help panel. Synthetic temporary data; network blocked.Publication and contribution checks
test/vitest-suites.json, and included in regeneratedrelease/public-source.json.Maintainer handoff
Publication scope or license changes: none.
Shared-source port: pending.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.