is it possible to have a cross-platform way to handle backspace and arrows keys within a C or OCaml program?
Actually an OCaml solution would be appreciated but many
Use ncurses to extract the sequences for the arrow key capabilities and then look for them when you read stdin. It's probably easier to use something like libedit or readline instead, and let that deal with the keyhandling.