trone this:
gem install rb-readline
在您的脚本中:
require 'rb-readline'
a = Readline::readline
input = `read -n 1000000 user_input; echo $user_input`.chomp