Context
@t3tools/mobile-terminal-native already registers T3TerminalSurface on both Apple and Android. The iOS implementation uses vendored GhosttyKit.xcframework / libghostty and owns a real terminal rendering surface.
Android currently has the same view name and event payloads, but the implementation is a simple TextView/EditText surface that prints the buffer and forwards typed text.
Why this matters
The terminal feature is used for interactive remote PTY sessions from thread/git controls. The JS/RPC layer is platform-neutral, but Android does not yet have terminal renderer parity with iOS.
Important behavior to preserve or add:
- remote PTY output rendering with terminal escape sequence support
- measured terminal
cols / rows resize events
- keyboard input, return, backspace, and control sequences
- scrollback and touch/scroll handling
- theme configuration parity with
buildGhosttyThemeConfig
- stable behavior under reconnects and large buffers
Feature examples
- Users can open a terminal for a thread/worktree and interact with a running shell.
- Project script launch flows can reuse or open terminal sessions.
- The UI should not report a full native Ghostty surface on Android until renderer parity is real.
Acceptance criteria
- Replace the Android
TextView/EditText fallback renderer with a real terminal emulator backend, preferably an Android Ghostty/libghostty build if feasible.
- Keep the existing JS contract stable:
{ data } input events, { cols, rows } resize events, initialBuffer, theme props, and terminalKey.
- Preserve the current Android module registration so the React Native screen and RPC code stay platform-neutral.
- Handle keyboard input, backspace, return, control sequences, scroll, resize, and large output buffers reliably.
- Update UI/status copy if the surface is partial or not Ghostty-backed.
- Add Android-native tests or instrumentation coverage for input/resize/render lifecycle where practical.
Current test coverage note
There are TypeScript tests around terminal model/state, route bootstrap, buffer replay, native module resolution, menu behavior, and theme logic (apps/mobile/src/features/terminal/*.test.ts). I did not find native Swift tests for the iOS Ghostty-backed view, and the existing Android native implementation has no native tests.
Context
@t3tools/mobile-terminal-nativealready registersT3TerminalSurfaceon both Apple and Android. The iOS implementation uses vendoredGhosttyKit.xcframework/libghosttyand owns a real terminal rendering surface.Android currently has the same view name and event payloads, but the implementation is a simple
TextView/EditTextsurface that prints the buffer and forwards typed text.Why this matters
The terminal feature is used for interactive remote PTY sessions from thread/git controls. The JS/RPC layer is platform-neutral, but Android does not yet have terminal renderer parity with iOS.
Important behavior to preserve or add:
cols/rowsresize eventsbuildGhosttyThemeConfigFeature examples
Acceptance criteria
TextView/EditTextfallback renderer with a real terminal emulator backend, preferably an Android Ghostty/libghostty build if feasible.{ data }input events,{ cols, rows }resize events,initialBuffer, theme props, andterminalKey.Current test coverage note
There are TypeScript tests around terminal model/state, route bootstrap, buffer replay, native module resolution, menu behavior, and theme logic (
apps/mobile/src/features/terminal/*.test.ts). I did not find native Swift tests for the iOS Ghostty-backed view, and the existing Android native implementation has no native tests.