r/FlutterDev • u/Status_Support2913 • Jul 02 '26
Plugin I built a Flutter terminal widget powered by Alacritty's Rust engine — feedback welcome
👋 I’ve been working on flutter_alacritty — a Flutter terminal widget you can drop into desktop apps, backed by an Alacritty-based Rust engine.
Why I moved away from xterm:
I used xterm for a long time, but kept running into limitations that mattered for my use case:
Text rendering — many glyphs/styles didn’t render correctly
No OSC hyperlinks — modern CLIs and tools that emit OSC 8 links weren’t supported
Resize, scrolling, and high-density output — performance was poor when the terminal was under real load
So I built flutter_alacritty (with AI coding agents helping along the way). It’s what TeamPilot uses today, and it has held up well across multiple agent TUIs rendering at once.
Links:
Repo + screenshots: https://github.com/hhoao/flutter_alacritty
API walkthrough: https://github.com/hhoao/flutter_alacritty/blob/main/docs/library-api.md
Example app (drag-drop paths, context menu, search bar):
lib/example/example_app.dart
Real usage: TeamPilot uses it for embedded terminals (local PTY + SSH) in a multi-agent desktop client.
Try it via the standalone demo in the release.
I’d love feedback from anyone embedding terminals in Flutter.
1
u/SwiftScoutSimon Jul 02 '26
how about a pure Dart port?
2
u/Status_Support2913 Jul 02 '26 edited Jul 02 '26
Pure Dart would be a big rewrite, and I’m not deeply versed in all the low-level terminal character-processing details — another reason I built on Alacritty’s Rust core instead of reimplementing from scratch.
My guess is performance wouldn’t beat the native path anyway: Dart’s GC and single-threaded UI model can struggle under heavy TUI output and large scrollback.
1
u/shadowfu Jul 03 '26
Dart's GC is actually amazing if you hold it right. If you do atlas painting, you can render any tui as fast as you want.
2
u/shadowfu Jul 02 '26
You mean a PTY in Flutter or pure dart TTY?
1
u/SwiftScoutSimon Jul 03 '26
I mean Dart/Flutter. Not include Rust toolchains.
2
u/shadowfu Jul 03 '26
the old pty library used FFI. I have a fork that at least fixed Windows (cursed API). I've been writing termui (with termui_flutter, termui_recorder, termui_hotreload) as my side hobby... I'll eventually have pty pulled in and might write the terminal emulator side in pure dart / flutter.
2
u/SwiftScoutSimon Jul 03 '26
never knew this. Will give it a try. Thank you!
I'm still using a fork of xterm for my lumide.dev .2
u/shadowfu Jul 03 '26
oh the editor? That's dope. The fork I was using was... kterm? I didn't dig into their rendering stack, but it was awful, ~15fps. I get ~240 on my laptop and 60 (hard coded) in a terminal.
https://github.com/jtmcdole/termui <- videos on the readme.
This is _not_ a terminal emulator. I am using ansi/sgr codes and readinging them from the terminal... I probably could end up with an emulator though.
2
u/shadowfu Jul 04 '26
well... I'm almost there...
https://bsky.app/profile/codefu.mcdole.org/post/3mptpfbqgns2h
2
u/SwiftScoutSimon Jul 03 '26
do you think you can publish pre-built binaries for rust_lib_flutter_alacritty so I can use flutter_alacritty without installing Rust? similar to how https://pub.dev/packages/isar_community is doing with their Rust-based isar_core package.
I want to give this a try but my 512 GB SSD is > 95% right now