Problem
When filtering a resource list (e.g. EC2 instances with /), pasting from the
clipboard does nothing. If I've copied an instance ID from somewhere, I have to
retype it by hand — for IDs like i-0123456789abcdef0 that's slow and easy to
get wrong.
Neither paste route works:
- Ctrl+Shift+V / tmux paste — the terminal sends the text as a bracketed
paste, which Bubble Tea delivers as tea.PasteMsg. The filter views only
forward tea.KeyPressMsg to their text input, so the paste message is
dropped.
- Ctrl+V — the bubbles
textinput supports this out of the box: it
responds with a command that reads the system clipboard and emits an internal
paste message. That message also gets dropped by the views, so the text is
never inserted.
Steps to reproduce
- Copy an EC2 instance ID to the clipboard
claws -s ec2
- Press
/ to open the filter
- Press Ctrl+V or Ctrl+Shift+V
Expected: the instance ID appears in the filter and the list narrows.
Actual: nothing happens.
Proposed fix
Forward paste and other textinput-bound messages to the filter input while it
is focused. This applies to every view with a filter (resource browser, service
browser, log view, tag search, multi-select dialogs) and to the : command
prompt. Both paste routes then work, including inside tmux and over SSH
(bracketed paste needs no clipboard tooling on the host).
I have a working implementation with tests and will open a PR.
Problem
When filtering a resource list (e.g. EC2 instances with
/), pasting from theclipboard does nothing. If I've copied an instance ID from somewhere, I have to
retype it by hand — for IDs like
i-0123456789abcdef0that's slow and easy toget wrong.
Neither paste route works:
paste, which Bubble Tea delivers as
tea.PasteMsg. The filter views onlyforward
tea.KeyPressMsgto their text input, so the paste message isdropped.
textinputsupports this out of the box: itresponds with a command that reads the system clipboard and emits an internal
paste message. That message also gets dropped by the views, so the text is
never inserted.
Steps to reproduce
claws -s ec2/to open the filterExpected: the instance ID appears in the filter and the list narrows.
Actual: nothing happens.
Proposed fix
Forward paste and other textinput-bound messages to the filter input while it
is focused. This applies to every view with a filter (resource browser, service
browser, log view, tag search, multi-select dialogs) and to the
:commandprompt. Both paste routes then work, including inside tmux and over SSH
(bracketed paste needs no clipboard tooling on the host).
I have a working implementation with tests and will open a PR.