lib/blocks/block.rb in bake-toolkit-2.19.0 vs lib/blocks/block.rb in bake-toolkit-2.19.1

- old
+ new

@@ -162,15 +162,20 @@ # raw mode changes the signals into raw characters. # original problem: Cygwin is compiled with broken control handler config, # which might not be changed due to backward compatibility. # the control handler works only with programs compiled under Cygwin, which is # not true for Windows RubyInstaller packages. - while IO.select([$stdin],nil,nil,0) do - nextChar = $stdin.sysread(1) - if nextChar == "\x03" - raise AbortException.new + ctrl_c_found = false + begin + while IO.select([$stdin],nil,nil,0) do + nextChar = $stdin.sysread(1) + if nextChar == "\x03" + ctrl_c_found = true + end end + rescue Exception => e end + raise AbortException.new if ctrl_c_found return @result end def callDeps(method) \ No newline at end of file