egui_tty
A terminal emulator widget for egui, drawn on top of Ghostty's VT engine.
Ghostty's engine — via libghostty-vt — owns
everything that makes a terminal a terminal: the parser, the screen and its scrollback, reflow
on resize, selections, and input encoding. egui_tty is the part it deliberately leaves out:
turning that grid into pixels, and turning window events into terminal events.
So this is a real terminal, not a log view. Full-screen programs, mouse reporting, bracketed paste, OSC 8 links, the Kitty keyboard protocol — all of it works, because the engine underneath is the one shipping in Ghostty.
- text selection, including double-click words, triple-click lines and alt-drag blocks
- clickable links, both OSC 8 and plain printed URLs
- search over the screen and the scrollback
- a light color scheme for light themes, where Ghostty's own would be unreadable
- attach anything: a local pty, a socket to another machine, a test harness
let stream = TtyStream ;
let mut terminal = new?;
// then, once per frame
let style = from_visuals;
terminal.ui;
output is an mpsc::Receiver<Vec<u8>> of what the program printed, and my_pty implements
the three-method Tty trait. A
whole shell in a window is about forty lines:
Building
libghostty-vt compiles Ghostty's VT engine from source, so building this crate needs a
Zig 0.15.x toolchain on PATH.
License
MIT