fix: re-query backend-size before initial render
The first backend-size query may return 80x24 before the terminal settles. Re-query immediately before the initial render to pick up the actual terminal dimensions.
This commit is contained in:
@@ -868,6 +868,9 @@
|
|||||||
(let ((backend-type (if (typep be 'cl-tty.backend:modern-backend)
|
(let ((backend-type (if (typep be 'cl-tty.backend:modern-backend)
|
||||||
"modern" "simple")))
|
"modern" "simple")))
|
||||||
(add-msg :system (format nil "* ~a backend ~dx~d *" backend-type w h)))
|
(add-msg :system (format nil "* ~a backend ~dx~d *" backend-type w h)))
|
||||||
|
;; Re-query terminal size before initial render (the first
|
||||||
|
;; query may return 80x24 before the terminal settles)
|
||||||
|
(multiple-value-setq (w h) (cl-tty.backend:backend-size be))
|
||||||
;; Initial render
|
;; Initial render
|
||||||
(cl-tty.backend:backend-clear be)
|
(cl-tty.backend:backend-clear be)
|
||||||
(view-status be w h)
|
(view-status be w h)
|
||||||
@@ -884,7 +887,6 @@
|
|||||||
(setf (st :connected) nil
|
(setf (st :connected) nil
|
||||||
(st :busy) nil)
|
(st :busy) nil)
|
||||||
(add-msg :system "* Connection lost — type /reconnect to retry *"))))
|
(add-msg :system "* Connection lost — type /reconnect to retry *"))))
|
||||||
;; Read key input via cl-tty read-event (10ms timeout)
|
|
||||||
;; Read key input via blocking read-char with 0.1s timeout
|
;; Read key input via blocking read-char with 0.1s timeout
|
||||||
;; (sb-unix:unix-simple-poll returns NIL on fd 0 in this SBCL,
|
;; (sb-unix:unix-simple-poll returns NIL on fd 0 in this SBCL,
|
||||||
;; so read-char-no-hang and read-event never fire. Raw blocking
|
;; so read-char-no-hang and read-event never fire. Raw blocking
|
||||||
|
|||||||
Reference in New Issue
Block a user