Hi All,

On Sat, Jul 19, 2014 at 08:34:36AM +0200, Alexander Burger wrote:
> Hi Enrique,
> 
> > $ cat file.txt |script.l
> > (key) does not wait for a keypress.
> 
> I think this is not possible, at least I don't see a direct way.

Hmm, so now this nagged me ;-)


> (key) reads from standard input. However, here the process is started in
> a pipe, so standard input is not the console, but a file. After reading
> with
> 
>    (in NIL
>       (until (eof)
>          (prinl (line)) ) )
> 
> EOF is reached on that file, so no further reading is possible, and
> (key) immediately returns NIL.
> 
> 
> You _can_ force standard input back to the console with 'ctty'
> 
>    (prinl "Press Key...")
>    (ctty "/dev/tty")
>    (key)
> 
> but still this does not do what you want, because (key) cannot set the
> terminal to raw mode. This is due to how the interpreter is implemented:
> It determines the console parameters at startup, to be able to restore
> them upon exit. However, in the above case, there is no console at
> startup.

I released a new version, with an improved 'ctty'. Now the standard I/O
channels are better initialized: 'ctty' checks the console parameters,
and properly clears the buffers, so that reading from standard input
(both raw or cooked) should work.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe

Reply via email to