How to get a single character without pressing enter?

Since ruby 2.0.0, there is a ‘io/console’ in the stdlib with this feature

require 'io/console'
STDIN.getch

Leave a Comment