Repository navigation
Report pixel coordinates in SGR-Pixels mouse mode - #820
Merged
Merged
Conversation
With DEC mode 1016 set the mouse encoder writes the position as it gets it, and it got the cell index, on a screen of one-pixel cells. A program using the mode saw every click in the top left corner. Give the encoder the cell size the terminal reports for CSI 14/16 t and the pixel at the centre of the cell. The cell formats divide by the cell size and report the same cells as before. The cell is clamped to the grid, so a position outside it, in a window larger than the terminal, is reported at the nearest cell. Closes #818.
This branch was previously deployed
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.
With DEC mode 1016 set, libghostty's mouse encoder writes the position as it gets it.
encodeMousegave it the cell index on a screen of one-pixel cells, so a program using the mode, such as terminal-browser in a Herdr pane, saw every click in the top left corner. The cell formats divide by the cell size and were not affected.encodeMousegives the encoder the cell size the terminal reports forCSI 14/16 tandTIOCGWINSZ, and the pixel at the centre of the cell. Reports in the cell formats (SGR, urxvt, UTF-8, X10) are the same as before.Checked live in a GUI frame (11x22 px cells) and a TTY frame (1x1) with
printf '\e[?1000h\e[?1006h\e[?1016h'; cat -v: clicks, drag motion and wheel report the cell's centre, and the same cells as before with 1016 off. Not checked with Herdr or terminal-browser.make -j8 allpasses on top of currentmain.Closes #818.