Repository navigation
fix(input): send no motion report for a drag that stays in its cell - #876
Merged
vyncint merged 2 commits intoNov 27, 2026
Merged
Conversation
Fixes vyncint#834 Signed-off-by: Álvaro Alonso <242080768+alvaroalonsoparrondo-a11y@users.noreply.github.com>
vyncint
previously approved these changes
Nov 27, 2026
vyncint
left a comment
Owner
There was a problem hiding this comment.
Reviewed against the issue; CI is green. Thank you.
Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com> # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #834
cells_betweenreturned the destination when a drag had no length, so under?1002/?1003adragwhose two ends were the same cell sent a press, a motion report and a release. xterm sends a motion report only when the pointer enters another cell (button.c,EditorButton), and the press has already recorded the cell, so the terminal delivers a click.crates/termlens/src/terminal.rs:cells_betweenreturns no cells when the ends are the same cell, and its comment says why.drag's rustdoc says a drag that stays in its cell is a press and a release.a_drag_that_goes_nowhere_still_reports_one_motion, becomesa_drag_that_stays_in_its_cell_crosses_none, which also checks that a one-cell drag still reports its one cell.tests/input.rs,a_drag_that_stays_in_its_cell_reports_no_motion, next toa_drag_reports_one_motion_per_cell_crossedand with the same fixture: the wire has[<0;7;2Mand[<0;7;2mand no[<32;. It fails with the oldcells_between. Ignored on Windows like its neighbours (Unix only: what Windows support would actually take #149).tests/input.rsstill pass (37 passed), so a drag of one cell or more still sends one motion report per cell crossed.Checked on macOS:
cargo fmt --all --check,cargo clippy -p termlens --all-targets --all-features -- -D warnings,cargo test -p termlens --test input, thecells_betweenunit tests,check-dco.shandcheck-no-ai-attribution.sh.Álvaro Alonso
242080768+alvaroalonsoparrondo-a11y@users.noreply.github.com