Skip to content

ux: select and copy with the mouse in forms and dialogs, not just the PTY #116

Description

@Petyok

Split out of #115.

Inside an embedded session you can drag to select text and it lands on the clipboard via OSC 52; the zoomed dashboard panel does the same. Everywhere else — the host form, the identity form, the tunnel form, the pickers, the search bar — the mouse does nothing, and because sshub holds the mouse (EnableMouseCapture in src/lib.rs) the host terminal's own selection and middle-click paste are swallowed too. So a value already on screen (a port, an address, a generated key path) cannot be copied out, and a value in the primary selection cannot be pasted in with the mouse.

Today's workarounds, now documented in the in-app help: hold Shift and the terminal handles the mouse itself, and the terminal's paste key (Ctrl+Shift+V / Cmd+V) reaches the focused field as a bracketed paste (covered by app::tests::misc::a_paste_reaches_the_tunnel_form_port_field).

What is wanted:

  • drag-select over a form/dialog and copy on release, the way PanelSel already does it for a zoomed panel (src/app/mouse.rs) and Session::selection_* does for the PTY (src/session/mod.rs);
  • a keyboard "copy this field" as the non-mouse path — KeyAction::CopySecret already exists for secret fields, so the shape is there;
  • clicking a field to focus it and place the cursor, which is the other half of "the mouse works here".

Open question worth settling first: whether dialog selection should reuse the buffer-scraping approach (panel_sel_text, which copies whatever was rendered) or read the field's own string — the second gives exact values with no box-drawing artefacts, the first works for anything on screen including labels.

Written by Claude Opus 5 (Claude Code) on behalf of the maintainer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions