Re: Raw Terminal I/O in lisp
- From: "Nikodemus Siivola" <nikodemus@xxxxxxxxxxxxxxxx>
- Date: 31 May 2006 05:26:47 -0700
fungsin.lui@xxxxxxxxx wrote:
My platform is linux 2.6 (sbcl or lispworks). I'm trying to figure out
how to do terminal I/O in noncanonical mode with lisp.
The easiest way is to write a C function that sets the terminal mode to
your specifications, and call it from Lisp.
(load-shared-object "my_terminal.so")
(define-alien-routine tty-raw int (fd int))
(tty-raw 0)
FD's 0-2 are standard in the sense that they are what you console talks
to. Which Lisp stream they are attached to is less-obvious, but I'd be
moderately surprised if STDIN wasn't what you want.
You may want to look at how Linedit deals with this (though there are
some things I would do differently if I was writing it now, but isn't
too horrible).
http://common-lisp.net/project/linedit
Cheers,
-- Nikodemus
.
- References:
- Raw Terminal I/O in lisp
- From: fungsin . lui
- Raw Terminal I/O in lisp
- Prev by Date: Re: xml and s-expression
- Next by Date: Re: Just can't hear enough about Cells?
- Previous by thread: Raw Terminal I/O in lisp
- Next by thread: Compilation Error: ACL 7.0 Trial Edition
- Index(es):