Linenoise
A small self-contained alternative to readline and libedit
...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.