Reputation: 695
In Python, we can use import readline
to make raw_input()
accept UP
key to show input history.
Is there any way to do the same thing in Ruby?
Upvotes: 3
Views: 106
Reputation: 41209
You can use Ruby's readline
library, like so.
require "readline"
while buf = Readline.readline("> ", true)
p buf
end
Upvotes: 5