Search code examples
prologprolog-toplevel

up,down,left and right cannot be used when using SWI-Prolog in terminal


I met a problem when I use prolog(swipl), after I type swipl in the terminal, code like '^[[A^[[B^[[D^[[C' shows when I press up, down, left, and right on my keyboard. Could somebody explain why? and how to fix it. Thanks in advance!


Solution

  • This means the readline/editline functionality isn't working. If you built it yourself, you probably have to install the development version of one of those libraries first and then rebuild. Or you can install rlwrap and do rlwrap swipl (which is helpful for other commands as well).