When used getsto receive user input, pressing the arrow keys displays text, presumably character codes. How can I prevent this, and how can I get the arrow keys to move the cursor correctly?
irb(main):001:0> foo = gets
^[[A^[[D^[[B^[[C
=> "\e[A\e[D\e[B\e[C\n"
Edit: maybe I should mention that I'm using Mac OS X and Terminal.app.
source
share