feat(terminal): send pastes with bracketed paste markers - #10
Merged
Conversation
:CrushPaste previously wrote the raw register or selection to the terminal channel, so Crush received it as a stream of individual keystrokes and large pastes took a long time to play out. Wrap the text in ESC[200~ ... ESC[201~ so the TUI receives a single paste event. Bubble Tea enables bracketed paste mode by default. Also fold the duplicated buffer/channel validation in paste() and paste_selection() into a local get_term_chan() helper. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Summary
:CrushPaste(andpaste_selection) wrote the raw register text to the terminal channel, so Crush received it as individual keystrokes and large pastes took a long time to play out.This wraps the text in bracketed paste markers (
ESC[200~ … ESC[201~) so the TUI receives one paste event. Bubble Tea enables bracketed paste mode by default, so Crush inserts the block in a single operation.Changes
terminal.bracketed(text): new helper returning the wrapped text.paste()andpaste_selection()send through it. Warnings and error paths are unchanged.get_term_chan().Testing
tests/terminal_spec.lua: 13 passing.cat -vterminal job that the PTY receives^[[200~ … ^[[201~around the pasted text.prompts.send()still sends raw text; it could reuseterminal.bracketed()if parity is wanted there.🤖 Generated with Claude Code