Repository navigation
Conversation
Printable keys were drawn only after a remote pty round trip, so typing on Android felt late on every character. Paint those keys before the pty echoes them, stop once the prediction cap is reached, and leave password, passcode, and PIN prompts on the remote path. Long secret prompts are matched on the current line so a leading Password token cannot be dropped. Keys refused at the pending-input cap stay in pendingInput until they are echoed. A control key keeps holding local echo while the pty only repeats earlier printable bytes.
cursor
Bot
force-pushed
the
cursor/android-terminal-echo-reconcile-b7a5
branch
from
September 23, 2026 08:46
44d2d4c to
c86801f
Compare
Owner
Author
|
Superseded by upstream READY PR on pingdotgg/t3code (same branch). |
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.
What Changed
Android terminal keystrokes now paint in the native surface before the remote pty echoes them. Printable input is fed to Ghostty immediately, then reconciled with the authoritative pty byte stream so a matching echo is drawn once. If the pty does not echo those bytes, the grid is rebuilt from the pty buffer and local echo stays off until a later keystroke is echoed verbatim.
Trusted prediction stops at the same pending-input cap as the untrusted probe, and further keystrokes fall back to remote echo. Password, passphrase, passcode, and PIN prompts, including ones with a URL or a parenthetical, are left for the pty. A control key holds local echo until the pty answers, and a rebuild does not resend device replies for history the previous session already answered.
This supersedes pingdotgg#13233 (Macroscope not approved) and pingdotgg#13226. The three blocking findings from pingdotgg#13233 are baked in:
takeLast(240)first, so a longPassword for 'https://…':line cannot drop the leadingPasswordtoken while keeping the trailing colon.pendingInput. Painting stays off until those bytes are echoed, so a partial echo cannot paint the next key and later reset the grid.awaitingRemotestays set while a new snapshot is only the outstanding printable echo (for examplelsafterls+ Enter). It clears once CR/LF or other control processing is visible.Fixes pingdotgg#12756
Supersedes pingdotgg#13233 and pingdotgg#13226
Why
Characters were drawn only after a full attach round trip. On a phone that delay is visible on every key. pingdotgg#13226 was not approved because a trusted session could grow the predicted buffer without limit, and the prompt check missed
Passcode:andPIN:. pingdotgg#13233 fixed those, then Macroscope rejected long-prompt detection, cap overflow after a partial echo, and clearingawaitingRemoteon a printable-only suffix.UI Changes
This changes when typed characters appear in the Android terminal. Layout is unchanged. This environment has no Android emulator (
/dev/kvmis unavailable) and no device, so there is no before/after recording. Reconciliation is covered byTerminalLocalEchoTest.iOS still paints from the remote buffer. This report is the Android client.
Checklist
Screenshots do not show the latency. A recording needs a device build of the native terminal module.