Thursday, August 27, 2026|20°C Partly Cloudy
Next edition scheduled
Your Personal Daily Intelligence
Edition 2026-07-13

TECHNOLOGY

Ghostel: Emacs Terminal Emulator Powered by libghostty

Ghostel is an Emacs package that provides a terminal emulator using libghostty‑vt through a native dynamic module written in Zig.

By Hacker News · 45d ago · Source: Hacker News

Full article

Ghostel is an Emacs package that provides a terminal emulator using libghostty‑vt through a native dynamic module written in Zig. The module is automatically downloaded on first use, so no separate toolchain is required; it can also be built from source with Zig if needed. Installation is available via MELPA, and developers may integrate it with use-package configurations that support :vc, :load-path, or manual paths. The package runs on macOS, Linux, FreeBSD, and native Windows, and supports x86_64 and aarch64 architectures for Intel and ARM processors.

Key features include full VT terminal emulation with 256‑color and true‑color support, OSC 8 hyperlinks, OSC 4/10/11 color queries, and the Kitty graphics protocol for inline images. Five input modes are provided—semi‑char, char, Emacs, copy, and line—each with dedicated keybindings for mode switching, navigation, and copy‑freeze behavior. The native PTY reader operates on a background thread, delivering asynchronous output to libghostty‑vt and notifying Emacs only when redraws are required, which maintains responsiveness during high‑volume streams.

Shell integration is automatic for bash, zsh, and fish, providing directory tracking via OSC 7, prompt navigation via OSC 133, and a helper function ghostel_cmd for invoking Emacs commands from the shell. Remote TRAMP sessions use the same renderer; the module sets TERM to xterm‑ghostty and can install the corresponding terminfo on remote hosts via an outbound SSH wrapper. Configuration options control native module installation, environment variables, scrollback limits, rendering timing, image handling, and password prompt detection.

Performance benchmarks show that the native PTY path processes roughly 75 MB/s of plain ASCII data, about four times the throughput of the built‑in Emacs term and significantly faster than alternative Emacs terminal packages. The architecture separates terminal state handling in the Zig module from Emacs‑level keymaps, buffers, and commands, allowing the renderer to preserve buffer positions across rendering changes without requiring Elisp to manage ad‑hoc marker logic.

Source transparency

Publisher
Hacker News
Reliability
high
Published
7/13/2026, 10:00:36 AM
Retrieved
7/13/2026, 10:00:36 AM
Relevance
80%
Confidence
85%
Read original at Hacker News

Botwin's Morning Wire publishes the full source article for reading convenience. Please visit the publisher for the original presentation and any updates.