Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mouse tracking #29

Merged
merged 2 commits into from
Sep 20, 2022
Merged

Add mouse tracking #29

merged 2 commits into from
Sep 20, 2022

Conversation

aheck
Copy link
Contributor

@aheck aheck commented Aug 7, 2022

This patch implements the legacy X10 mode and the newer SGR and SGR Pixel modes. It omits the EXT and URXVT modes because their use is discouraged anyway (https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking). With the first one the encoding is ambigious and the second one is no improvement over SGR mode. Not implementing them keeps the complexity down and if people actually use them (which they shouldn't) we could still add them in the future.

X10 can only encode a limited number of rows and cols (224) which can be a problem with modern ultra-wide displays. But AFAIK people used it in the past and it is good to have it for compatibility. SGR is the new encoding that fixes X10 and SGR Pixel mode was introduced by xterm in 2020 and allows to track pixels instead of rows and cols and might see more use in the future.

In addition to the unit tests (which I derived from values gathered from xterm) I tested it in midnight commander and clicking as well as scrolling with the mouse wheel worked as expected.

Copy link
Owner

@Aetf Aetf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good other than a few nitpicks. Also, please add new functions to libtsm.sym.

@aheck
Copy link
Contributor Author

aheck commented Sep 19, 2022

I think I fixed everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants