From 55166fc9ffac479dd2ad464aa75624da2e64f359 Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Thu, 14 May 2026 14:04:27 -0400 Subject: [PATCH] fix: add nil guards on w and h in tui-main before initial render backend-size can return nil for height (especially when the /dev/tty ioctl fallback hasn't been compiled in yet). view functions had nil guards but the direct (- h 4) calls in tui-main's initial render crashed before reaching them. --- org/channel-tui-main.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org/channel-tui-main.org b/org/channel-tui-main.org index 447fb65..ea4f545 100644 --- a/org/channel-tui-main.org +++ b/org/channel-tui-main.org @@ -918,6 +918,9 @@ Event handlers + daemon I/O + main loop. :stderr nil)) (tty-in (uiop:process-info-output cat-proc))) (add-msg :system (format nil "* cat pid=~a *" (uiop:process-info-pid cat-proc))) + ;; Guard against nil w/h from backend-size + (setq w (or (and (numberp w) (> w 0) w) 80) + h (or (and (numberp h) (> h 0) h) 24)) ;; Log backend info and terminal dimensions (cl-tty.backend:backend-clear be) (view-status be w h)