<div dir="ltr">The buffering setting has to do with buffering within the Scheme process, whereas the tty setting has to do with buffering within the operating system.  In order to get single-character reads from the terminal, you have to turn off both.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 4, 2019 at 10:22 AM Phillip Suero <<a href="mailto:philsuero@gmail.com">philsuero@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello!<div><br></div><div>I have been trying to get characters on the console without the need to</div><div>press enter using the |read-char| function.</div><div>The section 17.4.1 of Gambit's manual explains that setting the property</div><div><i>buffering </i>of a port should be enough to get chars without #\newline.</div><div>But I wasn't able to make it work with |current-input-port| or |console-port|.</div><div><br></div><div><font face="monospace">(define (getchar)</font></div><div><font face="monospace">  (port-settings-set! (current-input-port) (list buffering: #f))</font></div><div><font face="monospace">  (let loop ()</font></div><div><font face="monospace">    (write-char (read-char (current-input-port)))</font></div><div><font face="monospace">    (loop)))<br></font></div><div><br></div><div>I have been told that one option is to change my terminal settings to raw mode.</div><div>I have also tried to use <i>telnet</i> and I was able to make it work properly with the</div><div>client on <i>mode character</i>.</div><div><br></div><div>But, as far as I understand, there should be no need of <i>telnet</i> or raw terminal mode.</div><div>What am I missing here?</div><div><br></div><div>Thanks in advance,</div><div>Phil</div></div>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca" target="_blank">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://mailman.iro.umontreal.ca/cgi-bin/mailman/listinfo/gambit-list" rel="noreferrer" target="_blank">https://mailman.iro.umontreal.ca/cgi-bin/mailman/listinfo/gambit-list</a><br>
</blockquote></div>