Skip to content

About

Linux shell for Android OS, backed by ARM64 userspace emulator and Ghostty lib.

Topics

Resources

Stars

40 stars

Watchers

1 watching

Forks

Repository files navigation

Terminal

Probably the first ever Ghostty-based terminal emulator app for Android OS. Developed with heavy use of AI agentic coding (Claude Code, ChatGPT Codex), independently from Termux and similar apps.

Features:

  • All or almost all features of Ghostty VT engine, including Kitty graphics protocol, etc
  • Fast terminal rendering
  • 2 session modes: Linux userland (Alpine or Debian via the bundled arm64chroot emulator, default) and standard Android /system/bin/sh
  • First-run onboarding: feature intro + offline distribution setup
  • Pinch-zoom to change font size
  • Terminal text search
  • Userland backup/restore via tar archives
  • Configurable terminal themes with preview + builder for custom themes
  • Configurable extra keys
  • Optional mouse reporting
  • Optional word-based input for rich keyboard features (word suggestions, etc)

App demo

App is in active development state. Features may be added, removed or drastically changed within minor version update.

Some features will NOT be implemented:

  • Google Play, F-Droid or other stores distribution
  • Right-to-left input (VT engine issue)
  • Ambiguous-width characters as double width (VT engine issue)
  • Native, Termux-like Android-compatible userland
  • Android API bridge like Termux:API
  • On-boot automation like Termux:Boot
  • Tasker and other automation apps integration
  • Camera, microphone and other hardware access
  • Real chroot(2) for rooted devices instead of the user-space emulator
  • AI and other external services integration

Requirements

End user:

  • Android OS version 10 and newer (the Zig-built Ghostty library needs Bionic ELF TLS)
  • 64-bit CPU architecture (AArch64 or x86_64)

Developer:

  • Android SDK (platform 36, build-tools) and NDK r27+
  • JDK 17–21 to run Gradle
  • Host cmake ≥ 3.22 and ninja (or install the SDK cmake package)
  • Device/emulator with API 29+

Zig is not required to build the app; it is only needed to regenerate the prebuilt Ghostty library (see docs/native-build.md).

Build

Create local.properties:

sdk.dir=/path/to/Android/Sdk
# Only if the SDK has no cmake package; directory must contain bin/cmake:
cmake.dir=/usr

If the NDK is not installed inside the SDK, set ndkPath via ANDROID_NDK_HOME or add android.ndkPath in local.properties.

./gradlew :app:assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk

Bundling the Linux userland

Place rootfs tarballs in UserlandRootfs/ at the repo root before building (the directory is gitignored — the tarballs are never committed). The build scripts produce them:

scripts/build-alpine-rootfs.sh    # needs curl + xz; repackages the official
                                  # aarch64 minirootfs (sha256-verified)
scripts/build-debian-rootfs.sh    # needs mmdebstrap

UserlandRootfs/alpine_3.24.1_aarch64_rootfs.tar.xz
UserlandRootfs/debian_trixie_aarch64_rootfs.tar.xz

Only aarch64 rootfs are packaged — arm64chroot emulates an AArch64 guest on both device ABIs. Tarballs present at build time ship as APK assets and appear in the first-run onboarding chooser, which extracts the selected one offline (with on-screen progress). Without them the app builds and runs as a plain Android-shell terminal. Any asset named <id>_<version>_aarch64_rootfs.tar.xz is offered, so other distributions can be bundled the same way; a tarball must contain a root directory tree made of regular files, directories and links only.

Usage

  • Typing: tap the terminal to open the keyboard. Text goes straight to the shell; arrows/ESC/etc. are encoded per active terminal modes.
  • Toolbar: CTRL and ALT are sticky — tap CTRL, then c to send Ctrl-C. Other keys (ESC, TAB, arrows, HOME/END, PGUP/PGDN) send immediately.
  • Tabs: + opens a new session (Linux userland when installed, Android shell otherwise); long-press + opens the other kind — or the distribution setup when none is installed yet. Tap a tab to switch; × closes the current one. Closing the last tab exits the app.
  • Userland: you are (fake) root; apk add … (Alpine) or apt update && apt install … (Debian) works. Networking uses the app's permissions; everything actually runs as the app's unprivileged uid.
  • Scrollback: drag vertically on the terminal. Any key press snaps back to the bottom.
  • Font size: pinch to zoom (8–40 sp, persisted across restarts); the shell grid reflows to the new cell size.
  • Lifecycle: sessions survive rotation but not process death; there is no background service keeping shells alive once the app is killed.

Tests

Integration tests run on a connected device/emulator:

scripts/setup-emulator.sh   # one-time AVD creation (needs KVM)
scripts/run-emulator.sh
./gradlew connectedDebugAndroidTest

See docs/testing.md.

Documentation

License

Licensed under the Apache License, Version 2.0.

The app bundles third-party components — Ghostty (MIT), stb_image (MIT / Public Domain), and XZ for Java (0BSD) — whose copyright notices and license texts are retained in NOTICE and must be preserved in any redistribution.

About

Linux shell for Android OS, backed by ARM64 userspace emulator and Ghostty lib.

Topics

Resources

Stars

40 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages