pure MFL ~1.1 MB static binary no GTK · no VTE · no Node

machin-terminal

A minimal, fast, correct single-window terminal emulator written in pure MFL — the machin language. One static native binary. tmux is the multiplexer.

machin-terminal
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 —

Runs your tools

Verified hosting vim, htop, and tmux — full-screen alt-screen apps with scroll regions, reverse-video status bars, and Unicode pane borders.

PTY core

forkpty a real shell, non-blocking I/O, SIGWINCH on resize via ioctl — all through machin's C FFI.

VT100 / xterm parser

CSI/OSC/SGR state machine: cursor moves, erase, scroll region (DECSTBM), IL/DL, ICH/DCH/ECH, save/restore.

Alt-screen buffer

?47/?1047/?1049 with cursor save/restore — full-screen apps never clobber your scrollback.

True color + UTF-8

16 / 256 / 24-bit SGR, reverse video, and a UTF-8 decoder with box-drawing & symbol glyph coverage.

raylib renderer

A monospace glyph grid drawn at 60fps; resizable window that reflows and SIGWINCHes the shell.

One static binary

~1.1 MB, no GTK/VTE/Python/Node. Fast cold start, tiny footprint.

Why no native tabs or splits?

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.

Build & run

# 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