xterm3

Package version Pub points Pub likes License: AGPL-3.0-or-later

pub.dev/packages/xterm3 · API reference · Changelog · Source

xterm3 continues the line that started with xterm from TerminalStudio/xterm.dart and was kept alive as xterm2. The original package is unmaintained, and xterm2 has since diverged far enough — rewritten renderer, reworked buffer and reflow, new input and search paths — that it continues here under its own name. xterm2 users migrate by changing the dependency and the package in imports; the public API is unchanged.

xterm3 is a fast and fully-featured terminal emulator for Flutter applications, with support for mobile and desktop platforms.

This package requires Flutter version >=3.19.0

Screenshots

Features

  • 📦 Works out of the box No special configuration required.
  • 🚀 Fast Renders at 60fps.
  • 😀 Wide character support Supports CJK and emojis.
  • ✂️ Customizable
  • 🔗 Ligatures Opt-in via TerminalStyle(enableLigatures: true), with a ligature-capable font such as Fira Code, JetBrains Mono or Iosevka. Ligatures are drawn only where they fill exactly the cells they cover, so the grid never shifts; anything else falls back to per-cell painting.
  • Frontend independent: The terminal core can work without flutter frontend.

What's new in 3.0.0:

  • 📱 Enhanced support for mobile platforms.
  • ⌨️ Integrates with Flutter's shortcut system.
  • 🎨 Allows changing theme at runtime.
  • 💪 Better performance. No tree rebuilds anymore.
  • 🈂️ Works with IMEs.

Getting Started

1. Add the package from pub.dev:

flutter pub add xterm3

or add it to your package's pubspec.yaml file by hand:

dependencies:
  ...
  xterm3: ^6.0.1

2. Create the terminal:

import 'package:xterm3/xterm.dart';
...
terminal = Terminal();

Listen to user interaction with the terminal by simply adding a onOutput callback:

terminal = Terminal();

terminal.onOutput = (output) {
  print('output: $output');
}

3. Create the view, attach the terminal to the view:

import 'package:xterm3/flutter.dart';
...
child: TerminalView(terminal),

4. Write something to the terminal:

terminal.write('Hello, world!');

Done!

More examples

For the original package history, see TerminalStudio/xterm.dart.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Contributions are always welcome!

License

xterm3 is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). Linking it into an application makes that application a work covered by the AGPL: if you distribute it, or let users interact with it over a network, you must offer them its complete corresponding source under the same license.

The xterm and xterm2 work this package is derived from is MIT licensed and stays available under those terms; that notice is kept in LICENSE.MIT and NOTICE. Versions up to xterm2 5.3.0 are unaffected by this change — the AGPL applies from xterm3 6.0.0 onward.

Libraries

core
Terminal emulation core: escape-sequence parsing, the buffer/cell model, and the headless terminal engine. No Flutter dependency.
flutter
Alias for ui.dart, named to match Flutter's package:flutter/... import convention.
suggestion
ui
Flutter rendering for xterm3: the terminal view widget, controller, themes, cursor/selection styling, and keyboard shortcuts.
utils
xterm
The full xterm3 package: terminal emulation core, the Flutter view widget, and ZModem file-transfer support. This is the package's main entry point.
zmodem