chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Reading from STDIN with the hang


From: Christian Kellermann
Subject: Re: [Chicken-users] Reading from STDIN with the hang
Date: Tue, 1 Apr 2014 10:17:36 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Alexej,

* Alexej Magura <address@hidden> [140331 23:24]:
> K, so I???m currently working on an application that, if the user doesn???t 
> provide any options/operands, reads from STDIN, like GNU cat.  I just 
> finished adding signal-handling for SIGINT (Ctrl-c), however, now whenever I 
> press Ctrl-c nothing happens because (read-char) hangs until I press enter.  
> Is there a way to use (read-char) that won???t make it hang?  Maybe something 
> like: (if (not-null? (peek-char)) (read-char))?  I saw that (char-ready?) is 
> supposed to prevent the next call to (read-char) from hanging, but (while 
> I???m sure that (char-ready?) in fact works) I can???t seem to get it to 
> work.  
> 
> Anyone have any experience with this kind of issue; would using (read-line) 
> instead of (read-char) make a positive difference?  (I doubt it would)

Is this compiled code or interpreted code? If it is run in the
interpreter it might be that some module you load snatches sigint
from you. Parley is one of the candidates and maybe I should change
that behaviour. You can instantly try this by running your csi with
the (-n) switch which will prevent loading anything from .csirc.

Kind regards,

Christian

-- 
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]