Moritz Heidkamp  committed 27ef35f

chicken-select: set cbreak and (not echo) via stty so input gets handled immediately

  • Participants
  • Parent commits 1cb0f74

Comments (0)

Files changed (2)

File chicken-belt.meta

  (author "Christian Kellermann, Moritz Heidkamp")
  (category tools)
  (license "BSD")
- (depends matchable))
+ (depends matchable stty))

File chicken-select.scm

 #!/usr/bin/csi -s
-(use srfi-1 posix)
+(use srfi-1 posix stty)
 (include "chicken-env")
                     (iota (length all-chicks)))
           (print "Select a new Chicken, press 'q' to abort:")
-          (let* ((choice-raw (read-char))
+          (let* ((choice-raw (with-stty '(cbreak (not echo)) read-char))
                  (num (string->number (string choice-raw))))
             (if (and