The simplest way to add readline support to a terminal program that does not natively support it, is to call the program using rlwrap
. You can install the package of the same name through several package managers. Pressing ↑ in the examples below:
$ poly
Poly/ML 5.7.1 Release
- ^[[A
You can run it like this:
$ rlwrap poly
Poly/ML 5.7.1 Release
- stuff I typed from last session;
Or you can add an alias in your ~/.bashrc
or similar:
alias poly='rlwrap poly'