-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Mouse modes #2316
Mouse modes #2316
Conversation
Did several tests with the test_modes.js script across emulators with following results:
xterm.js is not as bad as I though in the beginning, still we are the ugly kid here. Furthermore the other emulators all differ slightly here and there, thus we should identify which things are worth to keep/adopt. In general we should stay close to the others to not break with assumptions on application side. Proposal:
Also tested the focusIn/focusOut event (DECSET 1004). This is not strictly bound to mouse reports (works also when mouse tracking is deactivated, no clue why xterm lists it there) with these results:
Imho only gnome-terminal does the right thing here with an initial report so applications know right from the start whether the emulator has focus or not. Next tests will deal with DEC locator modes. |
Did some tests with DEC locator modes and well, beside xterm no other terminal seems to support those atm (mlterm does, but does it wrong). Furthermore the protocol is really awkward, only press&release can be set to autotracking, some states are reported doubled in different flags, everything else has to be done by polling. Maybe I have overlooked something here. The interesting bit of the locator is the fact that it can report pixel metrics. Imho we should not mess with DEC locator at this point and remove the stub code we have (it was never activated by DECELR or attached to DECRQLP). If ppl are interested in a pixel oriented mouse tracking I think this needs more thinking and some iterations over terminal-wg. Maybe @egmontkob has some thoughts on this? |
I have no idea what "DEC locator mode" is :) A couple of mouse protocol enhancement ideas were collected at VTE 755183, out of which half cell reporting is my personal favorite. As per the spirit of my comments at Terminal-wg: simple image display, I'm basically against a protocol that introduces the concept of "pixel". However, fractional cells are okay, and given that ANSI-like escape sequences don't use decimal fractional digits, one way to encode them is to use a fixed denominator (e.g. 1000 or 1024 or lcm([1..n]) for some n), while another way is sure to report the exact numerator and denominator, the latter one then actually leaking the pixel size. (The first approach would also leak lot of information about the possible pixel sizes.) Therefore it's not that bad, after all. I'm curious whether there are nice use cases where more fine-grained reporting rather than just "half cells" is desired. Maybe eighth cells for dragging a character-based scrollbar which is potentially painted using the U+258x "eighth" glyphs. As usual, the hard part would be to agree on a reasonable subset of feature improvements (to satisfy real-life demands), rather than overengineering and including even the kitchen sink. |
Yes this was intentional, see in the commit log message. |
For existing mouse protocols and implementation differences, @textshell could provide more information. See also VTE 93. |
@egmontkob Ah thx for the pointers. With DEC locator I mean what xterm calls those locator modes:
Really dont want to bother with those atm (even had to recompile xterm to get it, seems Ubuntu does not bother either).
Yes I second your stance against pixels in terminals, still ppl might cry for this once image support lands in bigger scale (yes I see the link to that image thread there 😈). And tbh the current mouse protocols are all flawed, the button encoding is crap in all of them. Dont want to discuss a new protocol here, but I think something like SGR with better button encoding would come handy. And such a new thingy could easily change on the reported metrics by some additional flag.
Thats what I thought 👍, guess we will adopt that behavior.
Thx for the pointer, will take this into account. On VTE93 btw - our code intends to only report modifiers for 1000+ modes (but does not work for some other reason). Guess time to look into xterm sources for some comments about the intent here. Or maybe report them always, no clue yet. |
This PR tries to deal with mouse report issues. We already had several issues/discussions about mouse reports, still this field was never covered with proper testing. Our current mouse report code is quite unreadable / unmaintainable. Furthermore we have known issues on protocol handling as described in #1962.
TODO: