dbuenzli / down

An OCaml toplevel (REPL) upgrade
http://erratique.ch/software/down
ISC License
81 stars 3 forks source link

#quit does not persist history and unsaved recorded phrases #6

Closed dbuenzli closed 5 years ago

dbuenzli commented 5 years ago

If one has unsaved recorded phrases, down takes care to save them on exit and reload them on the ocaml invocation. This however only works if the user exits with C-d as we don't get the hand back on #quit.

ocaml has a few life-cycle hooks but none of these happen at shutdown, likely something that should be considered in the context of https://github.com/ocaml/ocaml/issues/7589.

down could try to patch the #quit directive but so far we didn't need to fiddle with those so I'm a bit reluctant to get into this.

dbuenzli commented 5 years ago

Well in fact an atexit handler could do.

dbuenzli commented 5 years ago

And the same holds for history saving in fact.