Check out my first novel, midnight's simulacra!

Readline

From dankwiki
Revision as of 19:20, 12 June 2012 by Dank (talk | contribs) (Created page with "GNU libreadline is the GNU component for line-based user interfaces. It supports history, completion, editing using vim and emacs keybindings, etc. Its equivalent in the [...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GNU libreadline is the GNU component for line-based user interfaces. It supports history, completion, editing using vim and emacs keybindings, etc. Its equivalent in the BSD world is libedit.

Building with readline

Autotools provides a AX_LIB_READLINE macro in the Autoconf Archives. It does not appear to provide pkg-config information.

Configuration

Upon intiialization, libreadline reads the files /etc/inputrc and $HOME/.inputrc to configure itself. Configuration can be performed on a per-program basis using conditional directives based off application names. An application sets its readline name by setting rl_readline_name before calling any libreadline functions.

Prompt

The prompt can be read from rl_prompt. It ought be set via argument to readline() or rl_set_prompt().