<div dir="ltr"><div>Dear Marc,<br></div><div><br></div><div>I've tracked down a TTY IO bug here, <a href="https://github.com/feeley/gambit/issues/100">https://github.com/feeley/gambit/issues/100</a> .</div><div><br></div><div>On os_tty.c:1062 which is "if ((n = read (d->fd, buf, len)) < 0)", the < should be changed to <= because a 0 return value *always* means EOF in the sense that the TTY has been closed, see issue for more info.</div><div><br></div><div>Then, os_tty.c:1063 needs to be updated from: "return err_code_from_errno ();" to something like "return n == 0 ? ___FIX([EOF-ERROR-VALUE]) : err_code_from_errno ();".</div><div><br></div><div><br></div><div>The purpose of ___FIX([EOF-ERROR-VALUE]) is to signal to the underlying logic, which is the Gambit C VTBL IO abstraction, that the TTY is closed so that the REPL's input will be #!eof and Gambit supposedly will shut down, instead of repeating the read() infinitely, as is the case now.</div><div><br></div><div>You know best which value is suitable in the place of [EOF-ERROR-VALUE] here - can you please suggest so a patch can be produced?</div><div><br></div><div>Thanks,</div><div>Mikael</div><div><br></div></div>