From d71ccb95c664ac7e97829ac45112e1160b4c5783 Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Thu, 14 May 2026 14:10:57 -0400 Subject: [PATCH] fix: guards on resize handler and render loop, O_RDONLY for /dev/tty --- org/channel-tui-main.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/org/channel-tui-main.org b/org/channel-tui-main.org index ea4f545..99710a5 100644 --- a/org/channel-tui-main.org +++ b/org/channel-tui-main.org @@ -967,7 +967,12 @@ Event handlers + daemon I/O + main loop. (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)) + (setq w (or (and (numberp w) (> w 0) w) 80) + h (or (and (numberp h) (> h 0) h) 24)) (setf (st :dirty) (list t t t)))) + ;; Guard w and h before render (resize or other code may have set them to nil) + (setq w (or (and (numberp w) (> w 0) w) 80) + h (or (and (numberp h) (> h 0) h) 24)) (when (or (first (st :dirty)) (second (st :dirty)) (third (st :dirty))) (cl-tty.backend:backend-clear be) (view-status be w h)