fix: add SIGWINCH resize handling for /dev/tty input path

Main loop now checks cl-tty.input::*terminal-resized-p* on every
iteration. When set (by SIGWINCH handler), re-queries backend-size
and marks all regions dirty for re-render.
This commit is contained in:
2026-05-14 08:56:00 -04:00
parent 226f979d38
commit 11cb466d4f
2 changed files with 52 additions and 91 deletions

View File

@@ -925,6 +925,12 @@ Event handlers + daemon I/O + main loop.
(setf (st :connected) nil
(st :busy) nil)
(add-msg :system "* Connection lost — type /reconnect to retry *"))))
;; Check for terminal resize (SIGWINCH sets this flag)
(when (boundp 'cl-tty.input::*terminal-resized-p*)
(when cl-tty.input::*terminal-resized-p*
(setf cl-tty.input::*terminal-resized-p* nil)
(multiple-value-setq (w h) (cl-tty.backend:backend-size be))
(setf (st :dirty) (list t t t))))
;; Read key input from /dev/tty (non-blocking)
(let ((raw-ch (read-char-no-hang tty nil nil)))
(when raw-ch