I am using Ocaml from a Linux terminal. Sometimes it gets stuck in a weird mode where it does not respond to my keyboard as expected. For example, if I press the arrows up, down, right, and left, it generates ^[[A^[[B^[[C^[[D
in input. Alternatively, sometimes if I type a letter only once it might repeat that same letter three times in a row and/or if I type the delete button it types "^H" instead.
Does anyone know what is going on here? I assume that I am inadvertently doing something to switch the mode but I don't how to switch it back or why it is switching in the first place.