Skip to content

feat: bracketed paste - #2

Merged
martian56 merged 2 commits into
mainfrom
bracketed-paste
Jul 18, 2026
Merged

feat: bracketed paste#2
martian56 merged 2 commits into
mainfrom
bracketed-paste

Conversation

@martian56

Copy link
Copy Markdown
Owner

Adds Paste(String) to InputEvent: with paste_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. Terminal gains paste_on/paste_off, and restore() turns the mode off. 42 tests pass (6 new). Version 0.2.0.

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.
@martian56 martian56 self-assigned this Jul 18, 2026
@martian56
martian56 merged commit c9baeb0 into main Jul 18, 2026
3 checks passed
@martian56
martian56 deleted the bracketed-paste branch July 18, 2026 04:54
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.

1 participant