rio icon indicating copy to clipboard operation
rio copied to clipboard

Text selection happens offset of mouse position

Open ararunaufc opened this issue 7 months ago • 3 comments

This is somewhat similar to #573 and #535, but in my case the selection happens on the line below and is restricted to the lower lines.

https://github.com/user-attachments/assets/ab479327-eaf8-405d-bc6f-569696fbae91

I'm using version 0.2.15 from Arch.

My config contents are:

theme = "OneHalfLight"

padding-x = 5
padding-y = [0, 5]

line-height = 1.2

[editor]
program = "/usr/bin/env helix"

[window]
width = 800
height = 658

[fonts]
family = "JetBrainsMono Nerd Font"
size = 14

[navigation]
mode = "Plain"

[shell]
program = "zellij"

And I guess the custom line-height may be the culprit.

ararunaufc avatar May 09 '25 14:05 ararunaufc

I'm still seeing this on the main branch release. I can work around the issue on my own installation by removing the line-height option. I've also managed to sort of work around the issue by editing this line but don't understand the rest of the codebase enough to know if this is the best location for the fix, or whether the issue is in the calculation of the cell size.

https://github.com/raphamorim/rio/blob/96bf02873ada3c1bc85d88c76a4699e00f726aa6/frontends/rioterm/src/mouse/mod.rs#L88

If it helps I'm on the latest NixOS unstable release, using Wayland and hyprland. I've tested against v0.2.20 and latest main branch

mattdavis90 avatar Jul 20 '25 12:07 mattdavis90

Ah right, the cell height isn’t computing line height. Lemme check

raphamorim avatar Jul 20 '25 12:07 raphamorim

Confirmed line-height was causing this for me as well, Version 0.2.30 (20230528.115631) via brew, macos.

j6k4m8 avatar Oct 29 '25 18:10 j6k4m8