Skip to content

Repository files navigation

BareTerm

BareTerm is a deliberately small, offline Android terminal. Kotlin owns Android lifecycle, IME, clipboard, extra keys and Canvas rendering. Rust owns the PTY process, VT parsing, screen/alternate buffers, scrollback and snapshot generation. It launches only /system/bin/sh, without root, Termux, WebView, networking or a third-party terminal emulator.

Requirements

  • Android Studio with Android SDK 35 and Android NDK (26 or newer recommended)
  • JDK 17
  • stable Rust and rustup
  • cargo-ndk
  • an arm64 Android 8+ device or x86_64 Android emulator

Install the native toolchain:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add aarch64-linux-android x86_64-linux-android
cargo install cargo-ndk

Install an NDK from Android Studio's SDK Manager. Set ANDROID_NDK_HOME if the SDK is not discoverable through ANDROID_SDK_ROOT or ANDROID_HOME.

Build and run

./scripts/build-rust.sh
./gradlew assembleDebug

preBuild depends on buildRust, so a normal Gradle build also compiles both native ABIs. The debug APK is:

app/build/outputs/apk/debug/app-debug.apk

Install and start from Android Studio, or use:

adb install -r app/build/outputs/apk/debug/app-debug.apk
adb shell am start -n dev.bareterm/.LauncherActivity

Open the root directory as a project in Android Studio, wait for Gradle sync, select an arm64 device or x86_64 emulator, and press Run. To run host-only tests:

cargo test --manifest-path terminal-core/Cargo.toml
./gradlew testDebugUnitTest

Changelog

Generals:

  • Renamed the application from RustTerm to BareTerm.
  • Changed the package name and namespace from dev.rustterm to dev.bareterm.

Interface:

  • The extra keys panel is hidden by default.
  • Added a menu action to show or hide the extra keys panel.
  • The panel visibility preference is saved between launches.
  • Added Font + and Font − menu actions.
  • The selected font size is saved.
  • Added a dedicated CTRL+C button near the beginning of the extra keys panel.
  • CTRL+C sends control byte 0x03 to the PTY.
  • Retained ESC, CTRL, ALT, TAB, arrow, PASTE, and KB buttons.
  • Terminal rows and columns are recalculated when the font size changes.

Shell:

  • The prompt is shortened to $ .
  • The current directory’s full path is no longer displayed before the input cursor.
  • Prompt configuration is stored in the app-private .baretermrc file.
  • Commands such as pwd and cd continue to work normally.

About

Offline Android terminal

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages