Add readline features in OCaml toplevel

It is painful for a Linux user to use the OCaml toplevel without the readline features.

Is there a method to enable/add these kinds of features in readline to the OCaml toplevel?

asked Mar 11, 2013 by anonymous

1 Answer

 
Best answer

I find 2 options that work very well for me:

utop provides a beautiful interface and supports completion, colors, parenthesis matching, etc. It can be installed by OPAM: opam install utop.

Another simple way I found is to use the rlwrap for line editing support: http://www.pkill.info/linux/man/1-rlwrap/

To start the OCaml toplevel with rlwrap, run:

$ rlwrap ocaml

Or wrap it in a shell script:

#!/bin/sh
exec rlwrap /usr/bin/ocaml "$@"
answered Mar 11, 2013 by anonymous
edited May 16, 2013

Please log in or register to answer this question.

Related questions

1 answer
1 answer
asked Dec 14, 2013 by anonymous
1 answer
1 answer
asked Aug 11, 2013 by anonymous
1 answer
asked Aug 11, 2013 by anonymous
1 answer
asked Apr 10, 2013 by anonymous
Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...