Judging from your questions it sounds like your like looking for curses-based frameworks. But in case that you're not, here are some console/irb-related gems I've written that may be useful:
- hirb - view framework for associating classes with views
- bond - custom readline completion made easy
- boson - console command framework
Now to answer your questions:
- Though I don't know how to do it, there is this nice curses app whose source code you could read.
- require 'readline' gives you those keybindings
- require 'highline'; answer = HighLine.new.ask('ask something') {|e| e.character = true }