Tweak
This commit is contained in:
parent
95200be30b
commit
f30362754f
|
@ -78,6 +78,8 @@
|
|||
|
||||
(define stdout (current-output-port))
|
||||
|
||||
;; Set up the TTY in Raw mode, but cache pre-raw mode
|
||||
;; for shutdown to restore terminal
|
||||
;; not current-input-port, which is a soft port
|
||||
(define stdin (standard-input-port))
|
||||
(define ts-old (make-termios-struct))
|
||||
|
@ -91,16 +93,18 @@
|
|||
vat
|
||||
(define list (make-initial-list))
|
||||
|
||||
(define (pre-render)
|
||||
(cursor-up 7))
|
||||
|
||||
(define (render str)
|
||||
(cursor-up 7)
|
||||
(display str stdout))
|
||||
|
||||
(define io (spawn ^io (current-input-port)
|
||||
#:init
|
||||
(λ (input)
|
||||
(with-vat vat
|
||||
(on (<- list 'view)
|
||||
(λ (str) (display str stdout)))))
|
||||
(with-vat
|
||||
vat
|
||||
(on (<- list 'view) render)))
|
||||
#:cleanup
|
||||
(λ (input)
|
||||
(signal-condition! halted?)
|
||||
|
@ -117,6 +121,7 @@
|
|||
(when ch
|
||||
(let-on ((command (<- list 'update ch))
|
||||
(str (<- list 'view)))
|
||||
(pre-render)
|
||||
(render str)
|
||||
(if (eq? 'quit command)
|
||||
(<-np io 'halt)
|
||||
|
|
Loading…
Reference in New Issue