Search packages, repositories and app categories

xterm cover
Package detailsv4.0.0

xterm

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

AndroidiOSWebmacOSWindowsLinux
30-day downloads
242K
Likes
239
Pub points
140

Install package

flutter pub add xterm

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

xterm.dart is a high-performance terminal emulator for Flutter, enabling developers to embed fully functional terminal interfaces in mobile and desktop applications. It supports ANSI escape sequences, keyboard input handling, and smooth text rendering across platforms. Designed for integration into CLI tools, development environments, or remote shell clients, it provides a seamless terminal experience within Flutter apps. The package is actively maintained and compatible with Android, iOS, Web, macOS, Windows, and Linux.

Use cases

  • Embedding a terminal in a code editor app
  • Building remote SSH clients
  • Creating interactive command-line tools
  • Developing developer console interfaces
  • Supporting terminal-based workflows in desktop apps

Key features

  • Full ANSI escape sequence support
  • Cross-platform compatibility
  • Efficient text rendering
  • Keyboard input handling
  • Customizable themes
  • Scrollback and line wrapping

Suitable for

  • Flutter developers building terminal-based apps
  • Tools requiring embedded shell access
  • Educational apps teaching command-line usage
  • Remote development environments
  • CLI tool integrations

Considerations

  • Requires understanding of terminal protocols
  • May need additional styling for UI consistency
  • Performance depends on terminal content complexity
  • Limited built-in command execution (external process needed)
  • Not suitable for heavy terminal emulation without optimization

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

xterm.dart

Actions Package version GitHub repo size GitHub issues GitHub pull requests

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

This package requires Flutter version >=3.0.0

Screenshots

Features

  • 📦 Works out of the box No special configuration required.
  • 🚀 Fast Renders at 60fps.
  • 😀 Wide character support Supports CJK and emojis.
  • ✂️ Customizable
  • ✔ 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 this to your package's pubspec.yaml file:

dependencies:
  ...
  xterm: ^3.2.6

2. Create the terminal:

import 'package:xterm/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:xterm/flutter.dart';
...
child: TerminalView(terminal),

4. Write something to the terminal:

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

Done!

More examples

  • Write a simple terminal in ~100 lines of code: https://github.com/TerminalStudio/xterm.dart/blob/master/example/lib/main.dart

  • Write a SSH client in ~100 lines of code with dartssh2: https://github.com/TerminalStudio/xterm.dart/blob/master/example/lib/ssh.dart

For a complete project built with xterm.dart, check out TerminalStudio.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Contributions are always welcome!

License

This project is licensed under an MIT license.

Categories

Dependencies

Dependency list 5 items

Source repository

Projects using this package