Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Saving input history from utop to file [closed]

Tags:

ocaml

utop

When I'm using OCaml utop every line of the input and output is printed into the console:

───┬──────────────────────────────────────────────────────────────┬───
   │ Welcome to utop version 2.10.0 (using OCaml version 4.14.0)! │
   └──────────────────────────────────────────────────────────────┘

Type #utop_help for help about using utop.

─( 22:17:51 )─< command 0 >─────────────────────────────{ counter: 0}─
utop # let x = 50;;
val x : int = 50

Is it possible to export each of user inputs and outputs from utop session into specific file?

like image 560
user1865034 Avatar asked Oct 20 '22 15:10

user1865034


1 Answers

Your input is saved by default at ~/.utop-history . Isn't that enough for your purpose?

You can also change location and file size by manipulating UTop.history_file_name and other variables.

like image 101
rafix Avatar answered Nov 10 '22 07:11

rafix