Skip to content

Highlight to copy to clipboard feature is inconsistent #125

Closed

Description

@zhengqunkoo

What happened

Rune copies highlighted text to system clipboard, but it doesn't copy highlighted text from files opened in (modal) editors to system clipboard. This is undocumented behaviour.

Also, there have been a few occasions where clicking on the Rune window to focus it copies a single character to the system clipboard, wiping out any previously copied text.

I understand I can turn off this feature with clipboard: "memory", however, setting that disables the highlight-to-copy feature.

What you expected

A consistent featureset: Either highlighting text does not copy to both the system and memory clipboards, or highlighting text also copies to memory clipboard.

Steps to reproduce

  1. Launch Rune
  2. Open terminal, highlight text. There is this choppiness to selecting and dragging the text. Clicking repeatedly copies single letters, words, or lines. Press to paste it
  3. Change Rune config to clipboard: "memory"
  4. Open terminal, highlight text, to try to paste it, doesn't work
  5. (to demonstrate copy pasting still works) Highlight text, there is no more of the aforementioned choppiness to highlighting text. Press to copy it and to paste it, it works

Area

Editor and text handling

Rune version

PR branch ejb711:fix-vi-mode-bash-fish @ 5efcff0

OS and architecture

Ubuntu 24.04, Wayland

Shell

No response

Logs, crash report, or screenshots

rune-issue-125.mp4

Relevant configuration

clipboard

Checks

  • I searched existing issues and this is not a duplicate.
  • I can reproduce this on the latest released version.

Activity

  1. added
    bug
    on Sep 21, 2026
  2. zhengqunkoo commented on Sep 22, 2026

    @zhengqunkoo
    ContributorAuthor

    In other terminal emulators, opening Vim and highlighting text in there uses the mouse capabilities of Vim (you can see it switch from INSERT to VISUAL mode), whereas holding down Shift and highlighting text uses the terminal emulator's mouse capabilities.

    In Rune, there is no distinction: the mouse input gets passed to both the terminal emulator and Vim.

    Another feature to consider implementing, on top of the clipboard behaviour to be addressed in this issue, is that even when clipboard: "memory", Shift+Highlight and <meta+c> copies text to the system clipboard.

  3. zhengqunkoo commented on Sep 23, 2026

    @zhengqunkoo
    ContributorAuthor

    There have been a few occasions where clicking on the Rune window to focus it copies a single character to the system clipboard, wiping out any previously copied text.

    So in gnome-terminal, click and drag only highlights a cell when the mouse moves horizontally by 1 cell, whereas in Rune the slightest movement (vertical or horizontal) highlights a cell. Fixing this would resolve the above quoted part of this issue.

    In Rune's vim editor, simply clicking (taking care not to move the mouse) on a letter highlights it, and you can see the highlight when you scroll - the highlight stays at the letter where you clicked, while vim's cursor moves along with the scroll. The previous fix would resolve this too.

  4. added a commit that references this issue on Sep 23, 2026
    c72b10d
  5. mvanhorn commented on Sep 23, 2026

    @mvanhorn
    Contributor

    Thanks, that was the missing piece. The mouse SDK calls SetSelectionEnd on every held-button event, even while the pointer is still inside the pressed cell, so a slight wobble during a click highlighted one character and copied it. The vim case comes from the same path: vim receives the click, but the drag events after it were still painting a terminal highlight, and that is the highlight you saw stay put while vim scrolled.

    I reworked #126 around this instead of removing highlight-to-copy. A highlight now starts only once the drag leaves the pressed cell, and when the running program tracks the mouse, clicks and drags go to it alone. Real drags, double-click and triple-click still copy. Shift+drag to override mouse tracking is a good idea, but the SDK currently ignores modified mouse events, so I left it out of this PR.

    If you get a chance to try the branch on Wayland, I'd like to know whether the focus-click problem is gone for you.

  6. zhengqunkoo commented on Sep 24, 2026

    @zhengqunkoo
    ContributorAuthor

    If you get a chance to try the branch on Wayland, I'd like to know whether the focus-click problem is gone for you.

    I've tried it, please see the latest comment in the PR #126.

  7. zhengqunkoo commented on Sep 24, 2026

    @zhengqunkoo
    ContributorAuthor

    Possibly Out of Scope Items

    • Middle click to paste doesn't work in the Vim buffers or the agent chat, it only works in terminals
  8. added 2 commits that reference this issue on Sep 30, 2026
    ba94baf
    f1b718e
  9. added 2 commits that reference this issue on Sep 30, 2026
    08cbcb1
    cac6cb1
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions