Skip to content

Is there a way to get relative position to a single cell with mouse events? #2362

Answered by mitchellh
ldemailly asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah that was my feeling as well. I think the best solution to this would be:

  1. Use in-band size reports
  2. Use mouse mode with pixels

This provides all the numbers to do trivial math to figure out offset within a cell. Since in-band size reports happen in-band, you can be confident in the order they're providing with respect to mouse reports for consistency with the terminal grid.

Since this issue was proposing totally new terminal behavior anyways, using something like in-band reports which is still only supported by a few terminals (Ghostty included) is still strictly better. 😄

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mitchellh
Comment options

Answer selected by mitchellh
Comment options

You must be logged in to vote
2 replies
@mitchellh
Comment options

@ldemailly
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2360 on October 02, 2024 17:54.