(define (echo-char) (define table (make-piece-table "hola")) (ui-initialize!) (let loop ((char (read-char))) (move-cursor! 0 0) (cond ((char=? #\q char) #f) (else (piece-table-insert! table 4 "hola" 'normal) (erase-screen!) (write-string (piece-table->string table)) (loop (read-char))))) (ui-deinitialize!)) (define (start arguments) (with-raw-io (current-input-port) echo-char)) ;; Extend `with-raw-io` with the initialization functions and just move to a ;; `with-tui` function that calls the provided thunk in the proper mode