Posts tagged readline
Do you want to ask the user for input at the command line, using a slick 1980's hacker movie prompt like this:
require 'readline' Readline.readline(">>")
>> I can write stuff here
Readline.readline(). That's what
irb uses for user input.
You're coding some Ruby. You use
gets.chomp to get user input. You run your ruby file. You type some text at the prompt. Looks good, right? But then you press the left arrow key and...
^[[D appears on the screen. WTF is that?