Skip to content

feat(mobile): Add terminal powered by libghostty#2056

Merged
juliusmarminge merged 5 commits intot3code/mobile-remote-connectfrom
t3code/mobile-remote-connect-rebase
Apr 16, 2026
Merged

feat(mobile): Add terminal powered by libghostty#2056
juliusmarminge merged 5 commits intot3code/mobile-remote-connectfrom
t3code/mobile-remote-connect-rebase

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Apr 16, 2026

Summary

  • Adds a new Expo-based apps/mobile client with app variants for development, preview, and production.
  • Implements mobile connection, thread, review, git, and terminal flows, including remote terminal attachment and session state handling.
  • Adds native terminal support via a local Expo module backed by the vendored Ghostty framework on iOS and a platform-neutral JS bridge.
  • Improves review rendering and highlighter support, including diff previews, word diffs, and Shiki-backed highlighting.
  • Extends shared/server runtime pieces to support the mobile client, remote runtime registration, and related orchestration changes.

Testing

  • Not run locally in this summary.
  • Added/updated unit tests for pairing, terminal behavior, review model/highlighter logic, thread activity, repository grouping, and native terminal module helpers.
  • Repo-level checks expected before merge: bun fmt, bun lint, and bun typecheck.
  • Mobile-specific runtime validation to perform: launch the app, create/connect a remote environment, open a thread, and verify terminal and review screens render and respond to input.

Note

Medium Risk
Medium risk due to adding a large vendored native iOS framework and changing iOS deployment target/build settings, which can impact build size, licensing compliance, and runtime compatibility.

Overview
Introduces a new local Expo module (apps/mobile/modules/t3-terminal) to provide a native terminal surface with a small JS bridge contract (input + resize events) and iOS implementation backed by a vendored GhosttyKit.xcframework, alongside Android parity via the shared view name/event payloads.

Updates the Expo app config to apply expo-build-properties and set the iOS deployment target to 16.1, and adds third-party notice documentation for the vendored Ghostty fork/revision.

Reviewed by Cursor Bugbot for commit aa9773b. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add in-app terminal powered by libghostty to the mobile app

  • Introduces a full terminal feature for the mobile app, including native iOS (T3TerminalView backed by libghostty/GhosttyKit) and Android (T3TerminalView backed by a ScrollView+EditText) terminal surface views registered as the T3TerminalSurface Expo module.
  • Adds ThreadTerminalRouteScreen as a dedicated full-screen terminal route (threads/[environmentId]/[threadId]/terminal) with session bootstrapping, input handling, font-size controls, and multi-terminal switching.
  • Introduces createTerminalSessionManager in client-runtime to manage per-session output buffers (capped by UTF-8 byte size), hydrate from snapshots, track known sessions, and invalidate by environment.
  • Adds a TerminalClosedEvent contract type and propagates closed events from the server terminal manager through to the web and mobile UIs.
  • Adds project-script and terminal-session menus to ThreadGitControls, allowing users to run scripts or open terminals directly from the git toolbar.
  • Refactors cwd/worktree resolution across git hooks and sheets into a shared useSelectedThreadWorktree hook.
  • Risk: Vendors two prebuilt static libraries (libghostty-fat.a for device and simulator) and raises iOS minimum deployment target to 16.1.

Macroscope summarized aa9773b.

Julius Marminge and others added 2 commits April 15, 2026 17:43
- Add thread terminal route and bootstrap
- Update mobile terminal native wiring and session state
- Prune Ghostty XCFramework macOS headers for iOS build
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 16, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d259fe25-302f-4eea-80bf-eab6afa546d5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/mobile-remote-connect-rebase

Comment @coderabbitai help to get the list of available commands and usage tips.

@juliusmarminge juliusmarminge changed the base branch from main to t3code/mobile-remote-connect April 16, 2026 05:14
@github-actions github-actions bot added size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Apr 16, 2026
@juliusmarminge juliusmarminge changed the title Add T3 Code mobile app with remote terminal feat(mobile): Add terminal powered by libghostty Apr 16, 2026
Comment thread packages/client-runtime/src/terminalSessionState.ts
Comment thread packages/client-runtime/src/terminalSessionState.ts
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 16, 2026

Approvability

Verdict: Needs human review

1 blocking correctness issue found. Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge
Copy link
Copy Markdown
Member Author

bugbot run

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 95ffb0f. Configure here.

- Resolve thread worktree context from thread detail before shell state
- Share cwd/worktree resolution across git actions, sheets, and terminal launch
- Add tests for terminal launch context helpers
- Reopen sessions if cwd or worktree changes
- Clear prior history on restart
- Preserve complete multibyte characters when capping retained output
- Keep closed terminal state isolated through reset and invalidation
@juliusmarminge juliusmarminge merged commit 608a2c3 into t3code/mobile-remote-connect Apr 16, 2026
11 of 12 checks passed
@juliusmarminge juliusmarminge deleted the t3code/mobile-remote-connect-rebase branch April 16, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). 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.

1 participant