This commit is contained in:
Jay McCarthy 2018-01-02 21:15:13 -05:00
parent c1f8234756
commit 37341a0c9c
2 changed files with 9 additions and 5 deletions

View File

@ -54,6 +54,7 @@
(display (A:dec-soft-terminal-reset) op)
(when clear?
(display (A:clear-screen/home) op))
(display (A:hide-cursor))
(parameterize ([current-display-drawing-parameters? op])
(set-drawing-parameters!)
(! (λ (r c ch)
@ -61,6 +62,7 @@
(when ch (display ch op))
#t)
1 1))
(display (A:show-cursor))
(flush-output op))
(define (draw-here x #:output [op (current-output-port)])

View File

@ -72,8 +72,9 @@
(string-append (reset-mode x11-extended-mouse-tracking-mode)
(reset-mode x11-any-event-mouse-tracking-mode)
(reset-mode x11-focus-event-mode)))
(define (make-raart #:alternate? [alternate? #f]
#:mouse? [mouse? #f])
(define (make-raart #:mouse? [mouse? #f])
(define alternate? #t)
(define t (open-term))
(define ch (make-async-channel))
;; Initialize term
@ -85,6 +86,7 @@
(lambda (handle)
(display/term t x11-mouse-off))))
;; Register for window change events
;; XXX some way to force this to be first
(display/term t (device-request-screen-size))
(capture-signal! 'SIGWINCH)
(define sig-th
@ -120,8 +122,8 @@
[e e])))
(define (chaos-output! c o)
(when o
(draw (crop 0 (*term-cols c)
0 (*term-rows c)
(draw (crop 0 (add1 (*term-cols c))
0 (add1 (*term-rows c))
o)
#:output (term-out (*term-t c)))))
(define (chaos-label! c l)
@ -140,4 +142,4 @@
(provide
(contract-out
[make-raart
(->* () (#:alternate? boolean?) chaos?)]))
(->* () () chaos?)]))