I’m making a simple Ruby shell. It’s all basing on an endless
while-loop and $stdin.gets. But here (on my Linux box) I cannot use
the arrow key. It just shows: “^[[A”. And it would be great too have a
tab-feature.
I’m making a simple Ruby shell. It’s all basing on an endless
while-loop and $stdin.gets. But here (on my Linux box) I cannot use
the arrow key. It just shows: “^[[A”. And it would be great too have a
tab-feature.
But how do you implement these features?
require ‘readline’
while line = Readline.readline('foo> ', true)
puts “You gave me: #{line}”
end