-
To get square pixels TUI apps often use TopHalfPixel = '▀'
BottomHalfPixel = '▄' But mouse tracking "\033[?1003h" only gives terminal grid coordinates I'm aware of "\x1b[?1016h" which is in pixels but then you need to map pixels to the grid and it's also quite verbose and less supported So I was wondering if we can use bit 7 and maybe 8 of Cb though... not sure of the actual encoding/if it makes sense |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
If the existing protocols do this, then I'm happy to support. If they do not, we're discussing a brand new terminal behavior and we should move to discussions. cc @rockorager |
Beta Was this translation helpful? Give feedback.
-
This would definitely be a new protocol. I don't think it's worth adding another protocol for this though, since the TUI can get enough info to calculate it from the pixel reports. This protocol would just push that calculation onto the emulator. And the likelihood of a "proximity" based protocol becoming more adopted than the existing pixel protocol is very unlikely. |
Beta Was this translation helpful? Give feedback.
-
I was proposing to keeping but extending the x10 , terminal grid coordinates one, using the same codes as there seems to be bits available
The point actually is that's already what the emulator does: it gets the host mouse and find which grid terminal coordinates match (including whichever real coordinate it is without lag as it knows its own size) That calculation is unnecessary complex for most apps But if we do do a new protocol, I do think it should be in TermX,TermY,%X,%Y ie relative to the terminal grid |
Beta Was this translation helpful? Give feedback.
Yeah that was my feeling as well. I think the best solution to this would be:
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. 😄