finds.dev

jart/bestline

ANSI Standard X3.64 Teletypewriter Command Session Library

View on GitHub

★ 588CNOASSERTIONupdated Nov 2025

// the take

Bestline is a single-file C library for readline-style terminal input — a fork of linenoise that fixes its UTF-8 handling, adds a kill ring, proper ANSI parsing, and signal handling. It's for anyone embedding a REPL or CLI prompt in a C/C++ application who wants something smaller than GNU Readline and more correct than vanilla linenoise. The entire thing is one .c file you drop in.

The ANSI escape sequence parsing is actually done properly, which is what kills linenoise in practice — garbage input no longer corrupts state. UTF-8 and multi-codepoint characters (CJK, Cyrillic, Greek) work correctly for cursor movement and editing, not just display. The binary footprint is genuinely small: 38KB statically linked, which matters for embedded tools or anything where you don't want a dependency chain. Kill ring support (Ctrl-Y, Alt-Y rotation) is a real quality-of-life feature missing from most readline alternatives.

The contributing policy requires emailing the author and assigning copyright before she'll accept a PR, which will scare off most contributors and has likely contributed to the low fork activity — 41 forks, relatively few external commits. The library has no vi editing mode, which is a hard blocker for vi users who have vi mode in bash and expect it everywhere. Windows support is real but explicitly second-class — the README tells you to use Cosmopolitan Libc to make it work properly, which is a non-trivial dependency if you just wanted a simple terminal library. Last commit was late 2025 and the issue tracker is sparse, so it's not clear how actively maintained it is.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
588
Forks
41
Language
C
License
NOASSERTION
Last commit
21 Nov 2025

// nearby

If bestline isn't quite it.

All repos →