Commits

Moritz Heidkamp committed 27ef35f

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

Comments (0)

Files changed (2)

  (author "Christian Kellermann, Moritz Heidkamp")
  (category tools)
  (license "BSD")
- (depends matchable))
+ (depends matchable stty))
 #!/usr/bin/csi -s
 
-(use srfi-1 posix)
+(use srfi-1 posix stty)
 (include "chicken-env")
 
 (assert-chicken-coop-exists)
                     (iota (length all-chicks)))
           (newline)
           (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 
                  num