How should I do clear screen on ocaml toplevel?

7.1k views Asked by At

I am using ocaml toplevel with ledit (ledit -l 100 ocaml) on Ubuntu 14.04. Since there is no way to do clear screen, all the time, I keep dwelling at the bottom of the screen.

I would like to know if there is a way to do clear screen at toplevel?

Thanks in advance.

Regards.

3

There are 3 answers

0
Jeffrey Scofield On BEST ANSWER

You could try:

# Sys.command "clear";;

However, it is normal to dwell at the bottom of the screen. The command line has worked this way for at least 30 years :-)

0
Str. On

Sys.command "clear" is quite functional - it clears and returns an int :-)

My favourite is Ctrl+l - unixoides only.

1
AName On

You can try: let clear = function x -> Sys.command("clear")+x;;

Then everytime you call: clear x;; where x is an int your screen should be clean again.