This commit is contained in:
Jay McCarthy 2018-01-04 16:32:47 -05:00
parent 77a6c2d2a2
commit b59996288e
1 changed files with 20 additions and 16 deletions

View File

@ -114,19 +114,6 @@
(lambda (handle) (lambda (handle)
(display/term t x11-mouse-off)))) (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)
(set! sig-th
(thread
(λ ()
(let loop ()
(define s (read-signal))
(match (lookup-signal-name s)
['SIGWINCH (display/term t (device-request-screen-size))
(loop)])))))
;; Listen for input ;; Listen for input
(set! input-th (set! input-th
(thread (thread
@ -137,16 +124,33 @@
(async-channel-put ch v) (async-channel-put ch v)
(loop)))))) (loop))))))
;; Register for window change events
;; XXX some way to force this to be first
(display/term t (device-request-screen-size))
(set! sig-th
(thread
(λ ()
(let loop ()
(define s (read-signal))
(match (lookup-signal-name s)
['SIGWINCH (display/term t (device-request-screen-size))
(loop)])))))
(capture-signal! 'SIGWINCH)
(void)) (void))
(define (chaos-stop! c) (define (chaos-stop! c)
(term-define c) (term-define c)
(release-signal! 'SIGWINCH)
(kill-thread sig-th)
(kill-thread input-th)
(when mouse? (when mouse?
(display/term t x11-mouse-off)) (display/term t x11-mouse-off))
(when alternate? (when alternate?
(display/term t (reset-mode alternate-screen-mode))) (display/term t (reset-mode alternate-screen-mode)))
(kill-thread sig-th)
(kill-thread input-th)
(release-signal! 'SIGWINCH)
(close-term t))]) (close-term t))])
(provide (provide