Skip to content

fix(mobile): Android terminal keystrokes paint immediately - #29

Closed
macodev00 wants to merge 1 commit into
mainfrom
cursor/android-terminal-local-echo-safe-f05f
Closed

macodev00 wants to merge 1 commit into
mainfrom
cursor/android-terminal-local-echo-safe-f05f

Conversation

@macodev00

Copy link
Copy Markdown
Owner

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.

Fixes pingdotgg#12756

Supersedes pingdotgg#13226

Why

Characters were drawn only after a full attach round trip. On a phone that delay is visible on every key. The previous attempt (pingdotgg#13226) was not approved because a trusted session could grow the predicted buffer without limit, and the prompt check missed Passcode: and PIN:.

UI Changes

This changes when typed characters appear in the Android terminal. Layout is unchanged. This environment has no Android emulator (/dev/kvm is unavailable) and no device, so there is no before/after recording. Reconciliation is covered by TerminalLocalEchoTest.

iOS still paints from the remote buffer. This report is the Android client.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Screenshots do not show the latency. A recording needs a device build of the native terminal module.

Open in Web Open in Cursor 

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.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL labels Sep 23, 2026
@macodev00

Copy link
Copy Markdown
Owner Author

Superseded by upstream READY PR on pingdotgg/t3code (same branch).

@macodev00 macodev00 closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Android: terminal typing echo is abnormally slow (per-keystroke delay)

1 participant