feat: bracketed paste - #2
Merged
Merged
Conversation
Adds Paste(String) to InputEvent: with paste_on() set, text pasted into the terminal arrives as one event with newlines normalized to \n, instead of being replayed as keystrokes where a pasted newline acts as Enter. The decoder recognizes ESC[200~, collects content until ESC[201~ (a partial terminator match flushes back into the content), converts \r and \r\n line breaks to \n, and keeps accumulating across read timeouts so a large paste spanning reads stays one event. Terminal gains paste_on/paste_off and restore() turns the mode off. Bumps the version to 0.2.0.
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.
Adds
Paste(String)toInputEvent: withpaste_on()set, pasted text arrives as one event with newlines normalized to\n, instead of replaying as keystrokes where a pasted newline acts as Enter. The decoder handles the ESC[200~ / ESC[201~ bracket, flushes partial terminator matches back into the content, normalizes \r and \r\n, and keeps accumulating across read timeouts.Terminalgainspaste_on/paste_off, andrestore()turns the mode off. 42 tests pass (6 new). Version 0.2.0.