From b1f22df93242c20dc68fad736804cf8163d86e6a Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 19 Dec 2011 16:03:45 -0500 Subject: [PATCH] Demo fancy output and raw input at the same time --- test-raw.rkt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test-raw.rkt b/test-raw.rkt index 1fe48da..4737d12 100644 --- a/test-raw.rkt +++ b/test-raw.rkt @@ -1,12 +1,17 @@ #lang racket/base (require "tty-raw-extension") +(require "ansi.rkt") (define (main) (tty-raw!) (let loop () (define ch (read-byte)) - (printf "Byte: ~v\015\012" ch) + (display (select-graphic-rendition ch)) + (printf "Byte: ~v" ch) + (display (clear-to-eol)) + (display "\015\012") + (display (select-graphic-rendition)) ;;(flush-output) (if (member ch '(4 8 127)) ;; EOF, C-h, DEL (exit)