With rlwrap cat or rlwrap bash I can use keybinding "jk" to exit from insert mode.

This does not work with rlwrap ghci. Why?

1 Answer 1


rlwrap's not very useful with programs which already do (even rudimentary) line-editing. According to its readme:

Commands that already use readline will always ask for (and get) single keypresses, which makes rlwrapping them rather pointless. However, if one uses the -a option, rlwrap will use its own line editing and history. Unforunately, in this case, rlwrap cannot detect whether 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.

You might get some use out of rlwrap using the -a option, as suggested. The first sentence is a little too specific (other programs can ask for "single keypresses" than those using readline).

  • It is not the programs that ask for single keypresses for which using rlwrap without the -a option is pointless, but the programs that always ask for single keypresses. You are right that readline is not the only input method that does so (editline, JLine and the zsh line editor are other examples). I'll make that clearer in the manpage.
    – Hans Lub
    Jul 1, 2018 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .