Cursor keys can work via: Readline.readline('') perhaps it can be tried automatically. via a rescue. If possible, then user input is read via readline. Otherwise default to stdin.