New lightweight termios package: rktermios

35 views
Skip to first unread message

Dominik Pantůček

unread,
Sep 21, 2020, 6:21:42 PM9/21/20
to Racket Users
Hello Racketeers,

as I learned that it is not possible to use the ansi package under CS,
because the C extensions do not work under CS, I decided to put together
a minimalistic termios wrapper using only Racket code.

It provides the bare minimum to set the terminal to "raw" mode and
should work under any POSIX system (tested on Linux and NetBSD). Usage
is VERY simple[1].

The ansi package can be patched immediately to use it and therefore work
under CS and charterm can be probably be patched as well - meaning it
will no longer rely on `stty' for this functionality.

The termios package uses similar approach but tries to implement all
termios capabilities which means it has to compile at least the
constants from termios headers. The same applies for serial package. It
might be possible to generate a .rkt file with those constants from the
header files during package build - but I didn't investigate that yet.

Any feedback is, of course, welcome. And all the ideas mentioned are
only suggestions.


Cheers,
Dominik

[1] https://docs.racket-lang.org/rktermios/index.html

Jay McCarthy

unread,
Sep 22, 2020, 10:34:50 AM9/22/20
to Dominik Pantůček, Racket Users
Hi Dom,

I think it would pretty easy to patch ansi. I already made this version:


which abstracts away the old extension. I think it would be really trivial to use yours. Thanks!

Jay

--
Jay McCarthy
Associate Professor @ CS @ UMass Lowell
http://jeapostrophe.github.io
Vincit qui se vincit.


--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/756b73f6-919e-fef2-b81c-7ad19fa1378c%40trustica.cz.
Reply all
Reply to author
Forward
0 new messages