GNU's readline (libreadline) is used ubiquitously in many programs to provide input line editing and history. The most popular example would probably be bash which uses readline to handle keyboard input. Many languages provide bindings to use readline natively, and it's dead-simple to use in any language.

4.4BSD editline(3)/libedit should probably be used in most cases instead, as it has a bit nicer API, cleaner code, and less restrictive license, but many people tend to prefer GNU stuff just because it's GNU.