Repository navigation
Send the wheel to an agent that tracks the mouse as a wheel report - #21
Merged
Merged
Conversation
mouse.go keeps the routing and the session view. dashboardMouse, dashboardHit, click and wheel move unchanged, with their comments, so the next change to the pane's wheel does not push mouse.go past 200 lines.
A wheel notch over the pane went to the agent as the ↑ or ↓ key. cathode with mouse capture on, its default, reads ↑ as the previous prompt, so the wheel recalled history instead of scrolling until /mouse turned capture off, and that had to be done again in every session. The runner now follows the agent's mouse modes through the emulator's mode callbacks, a full reset included. An agent that set a tracking mode gets a wheel report at the pane cell under the pointer, SGR if it set ?1006 and X10 if not. Any other agent still gets ↑ or ↓. Runner.Wheel encodes the report and writes it to the PTY as a key is written. The emulator's SendMouse writes to its reply pipe while holding the emulator lock, so an agent that stopped reading its input could freeze every render, and its X10 encoder writes a coordinate of 95 or more as two UTF-8 bytes. The notch is clamped to the pane rows on screen, and a terminal too short to draw the pane sends nothing. sendToAgent becomes a wrapper over toAgent, so the wheel reports a failed write the way a key does.
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.
Two commits, reviewable one at a time:
mouse.gostays under 200 lines./mouseturned capture off, in every session. The runner now follows the agent's mouse modes. An agent that set a tracking mode gets a wheel report (SGR with ?1006, X10 without) at the pane cell under the pointer. Any other agent still gets ↑ or ↓.Runner.Wheelencodes the report itself rather than using the emulator'sSendMouse. The commit message anddocs/architecture.mdsay why.Tests check the exact bytes the agent receives for each tracking mode, both encodings, the X10 range limit, a cleared mode and a full reset. They also check the pane cell under the pointer, the clamp on a short terminal, and that a click sends nothing.