Skip to content

Auto-copy highlighted text to clipboard on mouse-up - #446

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-5614-auto-copy-highlighted-text
Aug 10, 2026
Merged

Auto-copy highlighted text to clipboard on mouse-up#446
TheGreatAxios merged 3 commits into
mainfrom
cl-5614-auto-copy-highlighted-text

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Drag-select with mouse capture on now auto-copies finished OpenTUI selections to the system clipboard on mouse-up (CliRenderEvents.SELECTIONcopyFinishedSelection)
  • Status flash shows char count + preview; empty / mid-drag selections are no-ops; highlight clears after copy
  • Alt+M flash copy and docs/TUI.md updated to describe the new path alongside Alt+C

Closes CL-5614.

Test plan

  • Unit tests for copyFinishedSelection (copy, skip drag, skip empty, long preview)
  • Manual: drag-select transcript text with mouse capture on → text lands in clipboard, flash appears, highlight clears
  • Manual: empty click does not flash/copy
  • Manual: Alt+M still toggles native select; Alt+C copy overlay still works

OpenTUI emits CliRenderEvents.SELECTION once when a drag-select finishes
(mouse-up). A new copyFinishedSelection handler writes the selected text
through the system clipboard port, flashes a status line with a char count
and preview, then clears the highlight so the selection does not linger.
Empty selections and mid-drag updates are no-ops.

The Alt+M flash copy is updated to name the new behavior, and docs/TUI.md
documents the drag-select-copy path alongside the existing Alt+M and Alt+C
chords.
@linear-code

linear-code Bot commented Aug 9, 2026

Copy link
Copy Markdown

CL-5614

Align Alt+M copy/help strings and docs with mouse-up clipboard copy,
and pin the SELECTION event path through a live shell.
Keep the status flash single-line for short drag-selects, and make the
help row describe mouse capture as a toggle with capture as the default.
@TheGreatAxios
TheGreatAxios merged commit b9a1c8b into main Aug 10, 2026
2 checks passed
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