From: Tudor Lupei Date: 2010-04-01T05:21:53+09:00 Subject: Re: trap(:INT); system(); STDIN.gets(); ^C Might be worth to mention that both of the alternatives below will immediately exit after ^C ### ALT 1 trap :INT do puts puts 'Bye' exit end puts IO.popen('date').gets print 'Say something: ' STDOUT.flush puts "You said: #{STDIN.gets}" ### ALT 2 begin system 'date' print 'Say something: ' STDOUT.flush puts "You said: #{STDIN.gets}" rescue Interrupt puts puts 'Bye' exit end -- Posted via http://www.ruby-forum.com/.