Skip to content

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

Description

@iliasgws

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

  1. Open a thread in the Android client.
  2. Open the terminal view and tap into the input.
  3. Type a sequence of characters.
  4. Observe the delay between each key press and the character appearing on screen.

Expected behavior

Keystrokes should echo on screen immediately — imperceptibly, comparable to a native or desktop terminal. Typing in the terminal should feel instant.

Actual behavior

There is a consistently noticeable delay between tapping a key and the character appearing in the terminal. It happens on every keystroke, so typing feels abnormally slow overall.

Worth checking as likely causes: whether every keystroke waits for a full network round-trip before rendering (no local echo / no optimistic echo), and per-keystroke re-render overhead in the terminal view itself.

Impact

Major degradation or frequent failure

Environment

  • Device: Xiaomi 15 on HyperOS 4 beta 3 (CN ROM)
  • Platform: Android client (current build as of 2026-09-20)

🤖 GLM 5.3 Flash on behalf of iliasgws

Activity

  1. added
    acceptedfeature request accepted
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Sep 20, 2026
  2. juliusmarminge commented on Sep 20, 2026

    @juliusmarminge
    Member

    Triage

    Confirmed performance bug in the Android terminal input path. This is not a one-off device glitch.

    What the code does today

    Characters are not painted when the key is pressed. They only appear after a full remote round-trip:

    1. The native Android surface (apps/mobile/modules/t3-terminal/android/.../T3TerminalView.kt) uses a hidden 1×1 EditText / IME watcher and immediately emits onInput, then clears the field. The Ghostty canvas is not updated here.
    2. JS (ThreadTerminalRouteScreen → terminalEnvironment.write) sends a unary write RPC per keystroke.
    3. The character shows only when PTY output comes back on the attach stream and is rematerialized as a full initialBuffer string (use-terminal-session.ts: “until the native streaming API is released”).
    4. Native then prefix-diffs that string, feeds Ghostty, and snapshots the canvas.

    So echo latency is network RTT + JS rematerialization + native feed/repaint. Desktop/web use the same remote-echo model but usually have much lower RTT, so they feel instant. Android also pays IME cost (field is cleared every key; TYPE_TEXT_VARIATION_VISIBLE_PASSWORD to suppress suggestions).

    iOS uses the same remote-buffer architecture; this was only reported on Android.

    Related

    Suggested direction

    Optional repro notes if easy: does the same environment’s web/desktop terminal feel instant? Does iOS show the same delay?

  3. iliasgws commented on Sep 20, 2026

    @iliasgws
    Author

    I don't own an iOS device unfortunately 😕 but I can confirm that at least on fedora and the web it is instant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions