Skip to content

Can't paste from clipboard into the search filter #201

Description

@nick4eva

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

  1. Copy an EC2 instance ID to the clipboard
  2. claws -s ec2
  3. Press / to open the filter
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions