               return if bytes_read == 0 then -1 else buf.readUInt8(0)
             # reading from System.in, do it async
             data = null # will be filled in after the yield
-            rs.curr_frame().resume = ->
-              if data.length == 0 then -1 else data.charCodeAt(0)
+            rs.curr_frame().runner = ->
+              rs.meta_stack().pop()
+              rs.push(if data.length == 0 then -1 else data.charCodeAt(0))
             throw new exceptions.YieldIOException (cb) ->
               rs.async_input 1, (byte) ->
                 data = byte

              return if bytes_read == 0 and n_bytes isnt 0 then -1 else bytes_read
            # reading from System.in, do it async
            result = null # will be filled in after the yield
            rs.curr_frame().resume = -> result
            throw new exceptions.YieldIOException (cb) ->
              rs.async_input n_bytes, (bytes) ->
                byte_arr.array[offset+idx] = b for b, idx in bytes

  if node?
    # For the browser implementation -- the DOM doesn't get repainted
    # unless we give the event loop a chance to spin.
    rs.curr_frame().runner = -> rs.meta_stack().pop()
    throw new exceptions.YieldIOException (cb) -> setTimeout(cb, 0)


