I think you need to change to this: (thread-wait-for-i/o! (port->fileno (current-input-port)))