fix(tui): support pasting into text inputs - #54
Merged
Merged
Conversation
Bracketed paste was never handled. The top-level Update matched only KeyPressMsg, so tea.PasteMsg fell through to handleDataMsg and was logged as an unhandled message and dropped — nothing in the app accepted pasted text. Most painfully the login form, where a password could not be pasted in at all. bubbles' textinput already handles tea.PasteMsg, so routing is enough. Split updateCurrentView out of handleViewKeys so non-key messages reach the same views without being retyped as key presses, and forward paste to the login form, the connection form and the command palette. Table views take paste only while their filter input is focused, otherwise pasted text would be read as a burst of navigation keys. The login form stays frozen while a keygen is in flight, matching the key handling. PasteStartMsg/PasteEndMsg are matched as no-ops so the bracketing markers don't trip the unhandled-message warning.
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.
Problem
Bracketed paste was never handled. The top-level
Updatematched onlyKeyPressMsg, sotea.PasteMsgfell through tohandleDataMsgand was logged as an unhandled message and dropped — nothing in the app accepted pasted text.The login form was the worst of it: a password could not be pasted in at all.
Fix
bubbles'textinputalready handlestea.PasteMsg, so routing is enough.updateCurrentViewout ofhandleViewKeysso non-key messages reach the same views without being retyped as key presses.PasteStartMsg/PasteEndMsgare matched as no-ops so the bracketing markers don't trip the unhandled-message warning.Verification
Reproduced and verified against a live PA-440 (PAN-OS 11.2.10-h8) by driving the TUI under a pty and sending a real
ESC[200~ … ESC[201~sequence:Unit tests cover paste into each login field and that pasting is ignored while authenticating.
gofmt,go vet,golangci-lint(0 issues) andgo test -race ./...all clean.