fix(input): centralize and persist terminal input - #188
Draft
Lint111 wants to merge 8 commits into
Draft
Conversation
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.
Summary
TerminalInputControllerthe single pre-delivery owner for native xtermdata, Android helper-textarea mutations, IME composition, CJK/voice input,
paste, accessory controls, and modified Enter.
page reloads, browser minimization/tab discard, and phone sleep without
submitting restored text.
WebSocket/HTTP reconnects, and remove frames only after the server confirms an
accepted PTY write.
xterm-zerolag-inputat its source package with serializable,grapheme-aware multiline state and atomic restoration against stale terminal
frames.
User-visible fixes
cdcdandhomecd.autocomplete/helper-textarea buffer first.
framing for large payloads.
lifecycle or session transitions.
selection controls.
coherent while terminal output arrives.
Delivery model
Each browser has a stable
clientId; each session gets monotonic input sequencenumbers. Pending frames are stored before delivery and retried after reconnect.
The WebSocket route ACKs tagged input only after the PTY accepts it, while the
HTTP route uses a successful response as its ACK. Duplicate
(clientId, seq)frames are acknowledged without a second write.
Deduplication is intentionally server-memory-only. A server restart in the
narrow interval between a successful write and client ACK can produce a retry;
the design favors retaining user input over losing it.
Review scope
This is the IME, paste, draft, and input-delivery slice requested in the review
of #173. It does not include the mobile navigation pad, shutdown endpoint,
repository viewer, response viewer, history streaming, hook changes, or case
actions; those are separate PRs.
The diff is 45 files and +7,283/-1,006. Of the added lines, 4,032 (55%) are
focused tests. Generated
dist/and vendor bundles are not committed; thezero-lag overlay remains sourced from
packages/xterm-zerolag-input/.Commit structure
feat(zerolag): add serializable multiline input statefeat(input): add per-session terminal draft storerefactor(input): centralize terminal input arbitrationfeat(input): integrate persistent terminal draftsrefactor(input): route producers through controllertest(mobile): cover persistent terminal inputfix(input): acknowledge only accepted terminal writesdocs(input): document persistent delivery invariantsValidation
xterm-zerolag-input: 5 files, 194 tests passed; typecheck and package buildpassed
checks (45 files): passed
assets: passed
harness from test: isolate runtime state and PTY integration #175: 190 files passed, 1 skipped; 3,860 tests passed, 12 skipped
Related