Is there a robust way to know that a current OCaml toplevel process is (1) waiting for a user input, or (2) it is busy evaluating the previous statement?
A naive approach would be to detect #
from stdout of course, but a user might have run Printf.printf "# ";;
which will also print this.
I was wondering because I wanted to detect this on a VSCode plugin that interacts with OCaml REPL. Sequentially running selected sentences and immediately stopping when any sentence has failed · Issue #10 · monadius/vscode-hol-light · GitHub has a slightly more application-specific context.