Suppose I am using rlwrap like this: rlwrap --remember sml. That will start Standard ML of New Jersey:
Standard ML of New Jersey v110.79 [built: Sat Oct 26 12:27:04 2019]
-
If I enter Jer at the prompt and press Tab, rlwrap will complete it to Jersey . I only want completion for the code I enter, not for the lines that contain version information (and/or copyright information). Is there a way to exclude such lines from rlwrap's completion when using --remember?
This is beyond the capabilities of a "vanilla"
rlwrap. You can, however, easily achieve what you want with a with anrlwrapfilterAn
rlwrapfilter defines one or more callbacks ("handlers") that get called with e.g. the wrapped program's input and output lines. The filter can then modify those, or (in your case) feed them into the "completion list" (the list of possible completions). This makes it possible to fine-tune what to complete on:In many use cases for
--rememberyou might want to limit what goes into the completion list. If so, this is the way to do it.