Simple TTY style line editing with last line history. Small compact alternative to readline or editline.
Find a file
2025-11-13 08:49:48 -05:00
.editorconfig Initial commit. 2025-11-13 08:40:09 -05:00
.gitattributes Initial commit. 2025-11-13 08:40:09 -05:00
.gitignore Add SECURITY contact information. 2025-11-13 08:49:14 -05:00
aline.c Add README and source. 2025-11-13 08:49:48 -05:00
aline.h Add README and source. 2025-11-13 08:49:48 -05:00
ansiterm.h Add README and source. 2025-11-13 08:49:48 -05:00
LICENSE.md Initial commit. 2025-11-13 08:40:09 -05:00
Makefile Add README and source. 2025-11-13 08:49:48 -05:00
README.md Add README and source. 2025-11-13 08:49:48 -05:00
SECURITY.md Add SECURITY contact information. 2025-11-13 08:49:14 -05:00

aline

Simple TTY style line editing with last line history.

TTY Line Editing

Aline implements simple TTY style line editing and history for interactive input. GNU readline, BSD libedit, and rlwrap are not supported. See also stty(1).

    up      ^K      Cycle to the previous input line to edit.
    down    ^L      Cycle to the next input line to edit.
    left    right   Cursor left or right within line.
    ERASE   ^H  ^?  Erase character before the cursor.
    WERASE          Erase the previous white space delimited word.
    KILL            Erase current line input.
    EOL     ^M  ^J  Newline submits input line.
    EOF             End of file.
  • Assumes ANSI terminal escape sequences.

readline is predominately Linux and editline for BSD. They provide elaborate emacs and vi command line editing with history, which are fine for large projects, but sometimes they're just too much. aline (not to be confused with the typo alien) is intentionally light weight, providing just the common Unix line editing functions with a small circular line history, typically 16 lines.

The two principle functions are alineInit and alineInput; see aline.c main() for a usage example. This project is a spin-off from Post4.

Test

    $ make test

Test aline's line editing and history commands, CTRL+C or CTRL+D to exit.