Expose typed terminal input without an actor scheduler - #705
Merged
Merged
Conversation
skhaz
approved these changes
Sep 10, 2026
wolfy-j
force-pushed
the
feat/terminal-event-reader
branch
from
September 10, 2026 15:15
a544d72 to
d88afe7
Compare
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.
Compiled terminal clients need parsed input without creating a scheduler-owned process solely to receive keystrokes, plus a completion signal when the terminal disconnects. The former Unix reader parsed each read independently, so terminal sequences split at a buffer boundary could be corrupted.
This change exposes NewEventInputReader with serial typed callbacks while preserving NewInputReader as the scheduler adapter. Each session reports Done and Err, late cleanup cannot stop a restarted reader, and Stop restores terminal modes while serializing cleanup.
Unix input now uses the existing streaming decoder with a bounded incomplete-frame budget. The polished replay removes unrelated test commits, correctly releases accounting for completed multi-read events, and handles decoder-channel closure without spinning. Windows retains the established Console API reader.
Validation: the terminal service suite passes under race; framing and shutdown regressions pass repeatedly; repository-pinned scoped lint, vet, Windows compilation, and diff checks pass. Coverage includes fragmented mouse and navigation sequences, UTF-8 and paste input, EOF with data, framing bounds, restart generations, cancellation, and consecutive large valid pastes.