[Openmcl-devel] CCL, ncurses, and raw mode

Robert Munyer 2420506348 at munyer.com
Mon Mar 12 16:45:09 PDT 2018


I use a script written in CCL for SpamCop reporting, on Linux.

I wanted to eliminate as many keystrokes spent on the d----d spammers
as possible, so I made it respond to a "y" without needing an "Enter".

I have this in report-spam.asd:

  (defsystem "report-spam"
    :depends-on ((:require "pty") "smtp4cl")
    :components ((:file "report-spam")))

and this in report-spam.lisp:

  (unwind-protect (progn (ccl::disable-tty-local-modes 0 #$ICANON)
                         (do () ((not (read-char-no-hang))))
                         (format t "~&Send? [y/N] ")
                         (force-output)
                         (char-equal (read-char) #\y))
                  (ccl::enable-tty-local-modes 0 #$ICANON))



More information about the Openmcl-devel mailing list