Skip to content

mouse tracking blocks terminal-native text selection; allow suspending it at runtime #436

Closed

Description

@mikhail-angelov

What is the problem?

revdiff captures plain drag via mouse tracking, so terminal-native text selection is unavailable while tracking is on. Today's options are all-or-nothing at startup, and both fail real usage:

  • keep tracking on — no drag selection. The documented terminal bypass modifiers (Shift/Ctrl+Shift/Option+drag) differ per terminal and are unavailable in some embedded clients entirely: we run revdiff inside herdr (a terminal workspace) whose client implements neither shift-drag nor any other bypass, so with tracking on there is no way to copy diff text at all.
  • run with --no-mouse — selection works, but wheel scrolling and click navigation are gone for the entire session.

So today, in our setup, you either cannot copy a line of the diff at all, or you lose the wheel and mouse navigation for the whole session.

Proposed solution

A keymap action toggle_mouse (default m, remappable, shown in the help overlay) that flips tracking at runtime: suspending hands the mouse back to the terminal so plain drag selects natively, a second press restores wheel and click handling. The $EDITOR / output-flush suspend paths would restore the current mode rather than the startup flag.

PR #435 implements this (small diff, tests included) — happy to adjust or rework based on your direction here first.

Activity

  1. umputun commented on Nov 5, 2026

    @umputun
    Owner

    done in #435, it will be in the next release. The new toggle_mouse action has no default key, so map one in ~/.config/revdiff/keybindings:

    map m toggle_mouse
    

    pressing it hands the mouse back to the terminal, so plain drag selects text, and pressing it again brings back wheel and click handling. While tracking is off, the status bar shows a lit m.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions