A minimal, fast, correct single-window terminal emulator written in pure MFL — the machin language. One static native binary. tmux is the multiplexer.
user@host:~/ai/machin-terminal$ tmux new-session \; split-window -h ┌──────────────────────────────┬──────────────────────────────┐ │ vim term.src │ htop │ │ func feed(b) { │ CPU ▏▎▍▌▋█ 12.4% │ │ if T.st == 0 { ... } │ MEM ▏▎▍▌▋ 5.4G │ │ } │ PID USER CPU% COMMAND │ │ ~ │ 883 user 1.3 ./machin-… │ └──────────────────────────────┴──────────────────────────────┘ — box-drawing, 256/truecolor, alt-screen, reverse video: all rendered by the emulator —
Verified hosting vim, htop, and tmux — full-screen alt-screen apps with scroll regions, reverse-video status bars, and Unicode pane borders.
forkpty a real shell, non-blocking I/O, SIGWINCH on resize via ioctl — all through machin's C FFI.
CSI/OSC/SGR state machine: cursor moves, erase, scroll region (DECSTBM), IL/DL, ICH/DCH/ECH, save/restore.
?47/?1047/?1049 with cursor save/restore — full-screen apps never clobber your scrollback.
16 / 256 / 24-bit SGR, reverse video, and a UTF-8 decoder with box-drawing & symbol glyph coverage.
A monospace glyph grid drawn at 60fps; resizable window that reflows and SIGWINCHes the shell.
~1.1 MB, no GTK/VTE/Python/Node. Fast cold start, tiny footprint.
Because tmux already does it better — splits, tabs, sessions, detach/reattach — and it runs inside any correct terminal. machin-terminal's job is to be one fast, correct pane of glass and host tmux flawlessly. That's the st / foot philosophy: do one thing well.
# needs the `machin` compiler + a DejaVu Sans Mono font
git clone https://github.com/javimosch/machin-terminal
cd machin-terminal
./build.sh
DISPLAY=:0 ./machin-terminal