add bracketed paste support for TUI inputs#60
Open
evanbranigan-dotcom wants to merge 1 commit into
Open
Conversation
Enable crossterm's bracketed paste mode so pasted text arrives as a single Event::Paste(String) instead of individual key events. This fixes garbled input when pasting mnemonics, file paths (macOS wraps drag-and-drop paths in quotes), or birthday heights. - Enable EnableBracketedPaste on startup, disable on exit and panic - Handle Event::Paste in MnemonicInput, PathInput, BirthdayInput - Strip surrounding quotes from pasted paths (macOS drag-and-drop) Fixes zingolabs#43 AI Disclosure: Claude (Anthropic) assisted with codebase analysis and patch authoring. All code was reviewed and understood by the committer. Co-Authored-By: Claude Opus 4.6 (1M context) <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
Event::Paste(String)instead of individual key eventsEvent::Pastein all three input components (MnemonicInput, PathInput, BirthdayInput)Problem
Without bracketed paste mode, the terminal sends pasted text character-by-character. This causes:
'path')jcharacter is prepended (partial parse of theESC[200~sequence)Changes
main.rsEnableBracketedPasteon startup,DisableBracketedPasteon exit + panicmnemonic_input.rsEvent::Paste— type each characterinput.rs(PathInput)Event::Paste— strip quotes, type each characterbirthday_input.rsEvent::Paste— type each characterNo dependency changes — crossterm 0.29.0 (already in the lock file) has full support, and tuirealm 2.2.0 already surfaces
Event::Paste(String).Fixes #43
AI Disclosure
Claude (Anthropic) assisted with codebase analysis and patch authoring. All code was reviewed and understood by the committer.