Skip to content

Latest commit

 

History

80 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dart_terminal

Analyze VTE PTY

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.

Packages

Package pub.dev Description
ghostty_vte pub Dart FFI bindings for Ghostty's VT engine — paste safety, OSC/SGR parsing, key encoding
ghostty_vte_flutter pub Flutter terminal widgets + wasm initialiser
portable_pty pub Cross-platform PTY — native shells on desktop, WebSocket/WebTransport on web
portable_pty_flutter pub Flutter ChangeNotifier controller for PTY sessions

Quick start

git clone https://github.com/kingwill101/dart_terminal.git
cd dart_terminal
git submodule update --init --recursive
flutter pub get

Run the VTE tests

cd pkgs/vte/ghostty_vte
dart test

Run the PTY example

cd pkgs/pty/portable_pty
dart run example/pty_example.dart

Run the Flutter example

cd pkgs/vte/ghostty_vte_flutter/example
flutter run

Prerequisites

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

Prebuilt assets for downstream consumers

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:setup

This 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:

  1. Environment variableGHOSTTY_VTE_PREBUILT / PORTABLE_PTY_PREBUILT pointing directly to the .so / .dylib file.
  2. Monorepo .prebuilt/.prebuilt/<platform>/<lib> at the monorepo root (found by walking up looking for pubspec.yaml + pkgs/).
  3. 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-arm64

Platform 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.

Architecture

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

License

MIT

About

No description, website, or topics provided.

Resources

Stars

16 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages