Dear Marc,
I've tracked down a TTY IO bug here, https://github.com/feeley/gambit/issues/100 .
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.
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 ();".
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.
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?
Thanks, Mikael