How can I capture arrow keys in a terminal, without the user having to press "enter" after the arrow key?
Elf King
Look into the Ruby console libraries ruby-termios and ncurses-ruby.
来源:https://stackoverflow.com/questions/3301777/how-can-i-capture-terminal-arrow-keys-in-ruby