Dart & Flutter packages for building terminal applications. This monorepo provides two complementary package groups — a VT engine powered by Ghostty and a cross-platform PTY backed by Rust — that together give you everything needed to embed a fully functional terminal in any Dart or Flutter app.
| Package | pub.dev | Description |
|---|---|---|
ghostty_vte |
Dart FFI bindings for Ghostty's VT engine — paste safety, OSC/SGR parsing, key encoding | |
ghostty_vte_flutter |
Flutter terminal widgets + wasm initialiser | |
portable_pty |
Cross-platform PTY — native shells on desktop, WebSocket/WebTransport on web | |
portable_pty_flutter |
Flutter ChangeNotifier controller for PTY sessions |
git clone https://github.com/kingwill101/dart_terminal.git
cd dart_terminal
git submodule update --init --recursive
flutter pub getcd pkgs/vte/ghostty_vte
dart testcd pkgs/pty/portable_pty
dart run example/pty_example.dartcd pkgs/vte/ghostty_vte_flutter/example
flutter run| Tool | Required for | Install |
|---|---|---|
| Dart SDK ≥ 3.13 | All packages | dart.dev/get-dart |
| Flutter | Flutter packages & examples | flutter.dev |
| Zig ≥ 0.15 | Building libghostty-vt |
ziglang.org/download |
| Rust ≥ 1.92 | Building the PTY library | rustup.rs |
Don't want to install Zig or Rust? Download prebuilt libraries for your platform — the build hooks will use them automatically.
dart run tool/prebuilt.dart --tag v0.0.2
When ghostty_vte or portable_pty are consumed from pub.dev, you don't
need Zig or Rust installed — each package ships a setup command that downloads
the correct prebuilt library for your platform:
dart run ghostty_vte:setup
dart run portable_pty:setupThis places the native libraries in .prebuilt/<platform>/ at your project
root, where the build hooks find them automatically.
The build hooks search for prebuilt libraries in this order:
- Environment variable —
GHOSTTY_VTE_PREBUILT/PORTABLE_PTY_PREBUILTpointing directly to the.so/.dylibfile. - Monorepo
.prebuilt/—.prebuilt/<platform>/<lib>at the monorepo root (found by walking up looking forpubspec.yaml+pkgs/). - Project
.prebuilt/—.prebuilt/<platform>/<lib>at your project root (derived from the build system's output directory). This is the recommended approach for downstream consumers.
You can also specify a release tag or target platform:
dart run ghostty_vte:setup --tag v0.0.2 --platform macos-arm64
dart run portable_pty:setup --tag v0.0.2 --platform macos-arm64Platform labels follow the pattern {os}-{arch}:
linux-x64, linux-arm64, macos-arm64, macos-x64, windows-x64, etc.
Tip: Add
.prebuilt/to your.gitignore— these are binary artifacts that should be downloaded as needed, not committed.
dart_terminal/
├── pkgs/
│ ├── vte/ # Terminal VT engine
│ │ ├── ghostty_vte/ # Core Dart FFI bindings
│ │ └── ghostty_vte_flutter/ # Flutter widgets & controllers
│ └── pty/ # Pseudo-terminal
│ ├── portable_pty/ # Core PTY library (Rust FFI + web transport)
│ └── portable_pty_flutter/ # Flutter ChangeNotifier controller
└── tool/
└── prebuilt.dart # Download prebuilt native libraries
MIT