The readline library automatically checks whether the
current input port is a terminal, as determined by
terminal-port?, and it installs Readline only to replace
terminal ports. The readline/rep-start module
installs Readline without a terminal check.

By default, Readline’s completion is set to use the visible
bindings in the current namespace. This is far from ideal, but it’s
better than Readline’s default filename completion which is rarely
useful. In addition, the Readline history is stored across
invocations in Racket’s preferences file, assuming that Racket
exits normally.

Adds (requirereadline/rep) to the result of
(find-system-path'init-file), which is
"~/.racketrc" under Unix. Consequently, Readline will be
loaded whenever Racket is started in interactive mode. The
declaration is added only if it is not already present, as determined
by reading and checking all top-level expressions in the
file.

For more fine-grained control, such as conditionally loading
Readline based on an environment variable, edit
"~/.racketrc" manually.

A parameter. If #f (the default), then when a line is equal
to a previous one, the previous one is removed. If it set to
'unconsecutive then this happens only for an line that
duplicates the previous one, and if it is #f then all
duplicates are kept.

The new input port that you get when you require
readline is a custom port that uses Readline for
all inputs. The problem is when you want to display a prompt and then
read some input, Readline will get confused if it is not used when the
cursor is at the beginning of the line (which is why it has a
prompt argument.) To use this prompt:

This expression makes the first call to Readline use the prompt, and
subsequent calls will use an all-spaces prompt of the same length (for
example, when you’re reading an S-expression). The normal value of
readline-prompt is #f for an empty prompt (and
spaces after the prompt is used, which is why you should use
parameterize to restore it to #f).

A proper solution would be to install a custom output port, too, which
keeps track of text that is displayed without a trailing newline. As
a cheaper solution, if line-counting is enabled for the terminal’s
output-port, then a newline is printed before reading if the column is
not 0. (The readline library enables line-counting
for the output port.)

Warning: The Readline library uses the output port directly.
You should not use it when current-input-port has been
modified, or when it was not a terminal port when Racket was started
(eg, when reading input from a pipe). Expect some problems if you
ignore this warning (not too bad, mostly problems with detecting an
EOF).

Sets Readline’s rl_completion_entry_function to
proc. The type argument, whose possible values are
from ffi/unsafe, determines the type of value supplied
to the proc.

4License Issues

GNU’s Readline library is covered by the GPL, and that applies to
code that links with it. Racket is licensed with the LGPL, so the
Readline code is not used by default; you should explicitly enable
it if you want to. Also, be aware that if you write code that uses
this library, it will make your code link to the Readline library
when invoked, with the usual GPL implications.