finds.dev← search

// the find

jart/bestline

★ 588 · C · NOASSERTION · updated Nov 2025

ANSI Standard X3.64 Teletypewriter Command Session Library

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.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →