Linenoise is an ultra-lightweight, self-contained C library that implements line editing (single and multi-line) for terminal applications, intended as a simpler alternative to the much larger GNU Readline or libedit libraries. The library is zero-config, meaning you just include the source file(s) and use it, without heavy dependencies or external configuration. It supports basic editing features: moving the cursor, inserting characters, handling history, tab-completion, and hints, plus a multiplexing mode where the prompt can be hidden/restored when asynchronous output appears. It works on most VT100/ANSI-compatible terminals, and is portable across Unix-like systems. The code is compact (around 850 lines excluding comments) and designed for minimal footprint embedding into other projects (like CLI tools) that need line editing but don’t want the complexity of linking large libraries.
Features
- Minimal, single-file (or few files) C library for line editing in terminals
- Support for single-line and multi-line editing with cursor movement and history recall
- Built-in tab-completion and hint-display for suggestions during editing
- Multiplexing mode allowing asynchronous output while preserving prompt integrity
- Zero-configuration usage (just include the source, no external dependencies)
- Very compact code footprint and permissive BSD license making it embeddable