-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
[VT Mouse Mode] Translate SGR Mouse VT Sequences to MOUSE_EVENT_RECORD #3963
Conversation
- make InputEngineTests point out when a record was _not_ generated - add testing for SGR Mouse Input
0e3259b
to
e20291e
Compare
Notes off the dome: we need to make sure the work is tracked to convert a request for |
Do we though? (what follows is my literal train of thought. Go ahead and skip to conclusion) Can conpty just always be listening for mouse events from a terminal? It could continue to just handle mouse as it normally does, only giving the mouse events to the connected client when the client's requested mouse input of a particular form. When passthrough mode lands, this is a different story, then mouse mode changes will get passed to the terminal, and mouse events will be passed through to the client. This is bad though, because when passthrough mode exists, then the terminal would still be automatically synthesizing SGR sequences to write to the client, that the client hasn't requested yet. Fooey. Telling the passthrough client that it should "enable passthrough, then immediately write a [sequence] to disable mouse from the terminal" is probably also a bad solution. Conclusion: Okay, so conpty will need to manually emit a [sequence] to the Terminal saying "please enable SGR Mouse mode". Maybe conpty can emit that sequence at startup by default. Or whenever someone enables any VT mouse mode, or The follow-up tasks being:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got a bunch of comments for when you get back 😉
Also get ready - Michael updated all the parsers/adapters to be audit-friendly, which is going to conflict highly with this stuff.
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
shh bot, it's snowpocalypse 2020 in Seattle, give us a break |
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
calm down bot... Working on it now and this week |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm 🤏_this_ close to signing off, just want answers to a couple questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of things.
Hello @miniksa! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
Summary of the Pull Request
Upgrades the
InputStateMachineEngine
to take SGR Mouse VT Sequences and translate them intoMOUSE_EVENT_RECORDS
.References
https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Extended-coordinates
#376
PR Checklist
Detailed Description of the Pull Request / Additional comments
Modifications to
InputStateMachineEngine
I introduced various enum types...
CsiIntermediateCodes
: our supported intermediate codes. Currently only<
CsiEndCodes
: the last code used for SGR Mouse ModeCsiMouseButtonCodes
: which button was pressed. Mutually exclusive. Buttons beyond button 11 are ambiguous.CsiMouseModifierCodes
: bitfield of modifiers active for SGR Mouse Mode.CsiIntermediateCodes
is used first inActionCsiDispatch
to detect the VT Sequence. This kicks off a chain of function calls..._GetXYPosition()
: figure out where the mouse was clicked_UpdateSGRMouseButtonState
: read in what we found and update our internal state_WriteMouseEvent()
: generate an INPUT_RECORD and send it offModifications to Testing Suite
read below.
Also, made the test state a globally accessible/modifiable variable.
Validation Steps Performed
Added tests that cover...