-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Move MouseInput from TermAdapter to TermInput #4848
Conversation
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.
Yea I'm okay with this, but I'm curious why you decided to merge the classes into one rather than leave MouseInput
encapsulated
I was wondering about the merging too. I dunno; did we set a bad precedent with TerminalCore? 😄 |
At the same time, if you don't dislike it too much (@zadjii-msft), i guess it consolidates "things about generating VT input" into a single place! |
I didn't hate it enough to block it 😋 |
That's exactly what I was looking at... uh oh. But the nice thing now is that all kind of input is consistently in TerminalInput, rather than a random MouseInput object off on the side. That said, I'll just redirect all calls to |
Hello @DHowett-MSFT! 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 (
|
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.
Broke mouse mode in conhost
@DHowett-MSFT and I investigation findings:
Looks like we need to make the input buffer wake up the reader if it's still asleep. I'll work on a proper fix for this tomorrow morning. |
@msftbot make sure @miniksa signs off |
Hello @DHowett-MSFT! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
97916aa
to
863fab4
Compare
Verified that #4859 still works with the newest change. |
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 don't care that this variable is called _vtInputShouldSuppress
. We need a followup Area-CodeHealth + Area-Input workitem to clean up whose responsibility it is to notify connected clients in conhost.
@msftbot forget everything i just told you |
## Summary of the Pull Request Make TerminalControl synthesize mouse events and Terminal send them to the TerminalInput's MouseInput module. The implementation here takes significant inspiration from how we handle KeyEvents. ## References Closes #545 - VT Mouse Mode (Terminal) References #376 - VT Mouse Mode (ConPty) ### TerminalControl - `_TrySendMouseEvent` attempts to send a mouse event via TermInput. Similar to `_TrySendKeyEvent` - Use the above function to try and send the mouse event _before_ deciding to modify the selection ### TerminalApi - Hookup (re)setting the various modes to handle VT Input - Terminal is _always_ in VT Input mode (important for #4856) ### TerminalDispatch - Hookup (re)setting the various modes to handle VT Input ### TerminalInput - Convert the mouse input position from viewport position to buffer position - Then send it over to the MouseInput in TerminalInput to actually do it (#4848) ## Validation Steps Performed Tests should still pass.
Summary of the Pull Request
Move the contents and functionality of MouseInput from TerminalAdapter
to TerminalInput.
References
#545 - VT Mouse Mode (Terminal)
#376 - VT Mouse Mode (ConPty)
Detailed Description of the Pull Request / Additional comments
Pretty straightforward. The MouseInput class was a bit large though so I
split it up into a few files. This should make TerminalInput a bit
easier to manage.
mouseInputState
: enable some of the modes for mouse input. All savedto
_mouseInputState
.mouseInput
: basically justHandleMouse()
and any helper functionsValidation Steps Performed
Tests should still pass.