rlwrap  0.45
About: rlwrap is a "readline wrapper" allowing the editing of keyboard input for any command.
  Fossies Dox: rlwrap-0.45.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rlwrap Documentation

Some Fossies usage hints in advance:

  1. To see the Doxygen generated documentation please click on one of the items in the steelblue colored "quick index" bar above or use the side panel at the left which displays a hierarchical tree-like index structure and is adjustable in width.
  2. If you want to search for something by keyword rather than browse for it you can use the client side search facility (using Javascript and DHTML) that provides live searching, i.e. the search results are presented and adapted as you type in the Search input field at the top right.
  3. Doxygen doesn't incorporate all member files but just a definable subset (basically the main project source code files that are written in a supported language). So to search and browse all member files you may visit the Fossies rlwrap-0.45.tar.gz contents page and use the Fossies standard member browsing features (also with source code highlighting and additionally with optional code folding).
README.md

rlwrap v 0.45 February 2021

WHAT IT IS:

rlwrap is a 'readline wrapper', a small utility that uses the GNU Readline library to allow the editing of keyboard input for any command.

I couldn't find anything like it when I needed it, so I wrote this one back in 1999. By now, there are (and, in hindsight, even then there were) a number of good readline wrappers around, like rlfe, distributed as part of the GNU readline library, and the amazing socat.

You should consider using rlwrap especially when you need user-defined completion (by way of completion word lists) and persistent history, or if you want to program 'special effects' using the filter mechanism.

As it is often used with older or even obsolete software, rlwrap strives to compile and run on a fairly wide range of not necessarily recent Unix-like systems (FreeBSD, OSX, HP-UX, AIX, Solaris, QNX, cygwin, linux and probably quite a few more) This would not be possible without Polarhome's dinosaur zoo of ageing Unix systems

HOW TO USE IT:

If

$ <command> <args>

displays the infamous ^[[D when you press a left arrow key, or if you just want decent input history and completion, try:

$ rlwrap [-options] <command> <args>

You should not notice any difference compared to directly calling <command> <args>, except that you now can edit <command>'s input and recall its entire input history using the arrow keys.

Input history is remembered accross invocations, separately for different <command>s. CTRL-R will search the input history, like in bash. With the -r and -f options you can specify the list of words which rlwrap will use as possible completions, taking them from a file (-f option) or from <command>'s past in/output (-r option).

rlwrap continually monitors <command>'s terminal settings, so that it can do the right thing when command asks for single keypresses or for a password.

Commands that already use Readline, or a similar library, will always ask for (and get) single keypresses, so that rlwrapping them doesn't have any noticeable effect. To overcome this, one can use rlwrap with the --always-readline (-a) option; rlwrap will then use its own line editing and history. Unforunately, in that case, rlwrap cannot detect whether <command> asks for a password. This can be remedied by giving the password prompt (excluding trailing space and possibly the first few letters) as an argument to the -a option.

EXAMPLES:

Run netcat with command-line editing:

rlwrap nc localhost 80

Run lprolog and use its saved input history and lib.pl to build a completion word list:

rlwrap -f lib.lp -f . lprolog

Run smbclient (which already uses readline), add all input and output to the completion list, complete local filenames, avoid showing (and storing) passwords:

rlwrap -cra -assword: smbclient '\\PEANUT\C' 

INSTALLATION:

Usually just

./configure;
make
sudo make install

See the INSTALL file for more information.

FILTERS

Filters are perl or python plugins that enable complete (albeit somewhat fragile) control over rlwrap's input and output, echo, prompt, history and completion. They aren't used a lot, and remain therefore somewhat untested. rlwrap -z listing lists the installed filters, rlwrap -z <somefilter> displays a short help text for <somefilter>

AUTHORS

The GNU Readline library (written by Brian Fox and Chet Ramey) does all the hard work behind the scenes, the pty-handling code (written by Geoff C. Wing) was taken practically unchanged from rxvt, and completion word lists are managed by Damian Ivereigh's libredblack library. The rest was written by Hans Lub (hanslub42@gmail.com).

HOMEPAGE

https://github.com/hanslub42/rlwrap