From: Brian Candler Date: 2007-03-09T23:51:16+09:00 Subject: Re: Arrays - Storing User Input On Fri, Mar 09, 2007 at 11:00:04PM +0900, woodyee wrote: > Easy one but I can't figure this out! I'm trying to ask someone to > type some stuff, and then at the end (when they press the spacebar > without typing anything), I want to display what they typed. > > Here's my code: > > > something = [] > puts "Say something..." > something = gets.chomp > puts something > > I'm seeing what I typed after I hit the spacebar. Any ideas? Thanks!! You mean 'Enter' rather than 'Spacebar' ? For Linux, you can use the ruby-termios library (from RAA) to turn echo off/on, or highline (also from RAA) for a higher-level interface. http://raa.ruby-lang.org/project/highline/ Under Windows I have no idea.