Skip to content

Route bracketed-paste text to the focused input#63

Merged
Tannex merged 1 commit into
mainfrom
paste-support
Jul 20, 2026
Merged

Route bracketed-paste text to the focused input#63
Tannex merged 1 commit into
mainfrom
paste-support

Conversation

@Tannex

@Tannex Tannex commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Pasting into any input (prefix/member/locate filters, jq console, favorites note/pattern, mapping form, record editor) did nothing: Bubble Tea delivers a paste as one tea.PasteMsg (bracketed paste is on by default), but Model.Update only routed tea.KeyPressMsg, so the message died in the default arm before any widget saw it. The bubbles textinput/textarea widgets already handle tea.PasteMsg natively.

handlePaste forwards the message to whichever input owns the keyboard, mirroring handleKey's precedence order (editor → favorites inputs → query console → mapping form → search inputs), including the editor's pending-nav flush and the query console's completion refresh; pastes with nothing focused are dropped.

Verified with unit tests for the search input (insert-at-cursor), query console, favorites pattern input, and the nothing-focused/list-mode drop cases — plus a real bracketed paste through tmux (paste-buffer -p) landing in the prefix input of the live TUI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CS2LZMn2YJdebAiry2jzdP

The terminal delivers pasted text as a single tea.PasteMsg, but Update
only routed KeyPressMsg, so pastes were silently discarded before any
widget saw them — no input in the app could be pasted into. handlePaste
now mirrors handleKey's precedence (editor, favorites inputs, query
console, mapping form, search inputs) and forwards the message to
whichever input owns the keyboard; the textinput/textarea widgets
already knew how to insert it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CS2LZMn2YJdebAiry2jzdP
@Tannex
Tannex merged commit 595a5be into main Jul 20, 2026
4 checks passed
@Tannex
Tannex deleted the paste-support branch July 20, 2026 06:49
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