From: brabuhr@... Date: 2010-04-01T04:49:25+09:00 Subject: Re: trap(:INT); system(); STDIN.gets(); ^C On Wed, Mar 31, 2010 at 2:47 PM, Tudor Lupei wrote: > trap :INT do >  puts >  puts 'Bye' >  exit > end > > # system 'date' > print 'Say something: ' > STDOUT.flush > puts "You said: #{STDIN.gets}" > > > When prompted to say something, hitting Ctrl+C will call trap(:INT) > block. > However, after uncommenting line 7, Ctrl+C won't cause a call to > trap(:INT) block unless I send a newline or EOF. With or without line 7, here both programs behave the same (Ctrl-C + EOF -> Bye): $ ruby a.rb Say something: Bye $ ruby b.rb Wed Mar 31 15:43:32 EDT 2010 Say something: Bye > Platform: linux; ruby 1.8.7 $ uname -a Linux mcu.claw.ctc.com 2.6.18-164.11.1.el5 #1 SMP Wed Jan 20 07:39:04 EST 2010 i686 i686 i386 GNU/Linux $ ruby -v ruby 1.8.5 (2006-08-25) [i386-linux]