From b17c5012317a91b681b396eb6b1f834edee2d693 Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Wed, 13 May 2026 19:20:00 -0400 Subject: [PATCH] fix: replace draw-rect on framebuffer with draw-text draw-rect has no method on raw arrays (only on framebuffer-backend, simple-backend, modern-backend). Three calls in view-status, view-chat, and view-sidebar passed the framebuffer array to draw-rect, causing 'no applicable method' crash on startup. Replaced with (draw-text ... (make-string w #\Space) nil bg) which fills the same area with background spaces. --- lisp/channel-tui-view.lisp | 6 +++--- org/channel-tui-view.org | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/channel-tui-view.lisp b/lisp/channel-tui-view.lisp index 46e66a2..0264cbf 100644 --- a/lisp/channel-tui-view.lisp +++ b/lisp/channel-tui-view.lisp @@ -21,7 +21,7 @@ Returns a list of strings, one per line." (or (st :foveal-id) "passepartout") (or (st :rule-count) 0))) (right (format nil "$~,2f ~a" (or (st :session-cost) 0.0) (now)))) (dotimes (col w) - (cl-tty.backend:draw-rect fb col (- h 1) 1 1 :bg bg)) + (cl-tty.backend:draw-text fb 0 (- h 1) (make-string w :initial-element #\Space) nil bg)) (cl-tty.backend:draw-text fb 1 (- h 1) left fg nil) (cl-tty.backend:draw-text fb (- w (length right) 2) (- h 1) right fg nil))) @@ -151,7 +151,7 @@ Returns a list of strings, one per line." (dolist (pair pairs) (when (>= y (- h 4)) (return)) (destructuring-bind (text color &optional bg) pair - (when bg (cl-tty.backend:draw-rect fb 0 y w 1 :bg bg)) + (when bg (cl-tty.backend:draw-text fb 0 y (make-string w :initial-element #\Space) nil bg)) (cl-tty.backend:draw-text fb 0 y text color nil)) (incf y))))))))) @@ -170,7 +170,7 @@ Returns a list of strings, one per line." (y 0)) ;; Vertical separator (dotimes (row h) - (cl-tty.backend:draw-rect fb (1- x) row 1 1 :bg (theme-color :separator))) + (cl-tty.backend:draw-text fb (1- x) row " " nil (theme-color :separator))) ;; Focus panel (cl-tty.backend:draw-text fb (1+ x) (incf y) " FOCUS" (theme-color :accent) nil) (incf y) diff --git a/org/channel-tui-view.org b/org/channel-tui-view.org index 896fcfe..d69c007 100644 --- a/org/channel-tui-view.org +++ b/org/channel-tui-view.org @@ -66,7 +66,7 @@ Returns a list of strings, one per line." (or (st :foveal-id) "passepartout") (or (st :rule-count) 0))) (right (format nil "$~,2f ~a" (or (st :session-cost) 0.0) (now)))) (dotimes (col w) - (cl-tty.backend:draw-rect fb col (- h 1) 1 1 :bg bg)) + (cl-tty.backend:draw-text fb 0 (- h 1) (make-string w :initial-element #\Space) nil bg)) (cl-tty.backend:draw-text fb 1 (- h 1) left fg nil) (cl-tty.backend:draw-text fb (- w (length right) 2) (- h 1) right fg nil))) @@ -196,7 +196,7 @@ Returns a list of strings, one per line." (dolist (pair pairs) (when (>= y (- h 4)) (return)) (destructuring-bind (text color &optional bg) pair - (when bg (cl-tty.backend:draw-rect fb 0 y w 1 :bg bg)) + (when bg (cl-tty.backend:draw-text fb 0 y (make-string w :initial-element #\Space) nil bg)) (cl-tty.backend:draw-text fb 0 y text color nil)) (incf y))))))))) #+END_SRC @@ -221,7 +221,7 @@ Returns a list of strings, one per line." (y 0)) ;; Vertical separator (dotimes (row h) - (cl-tty.backend:draw-rect fb (1- x) row 1 1 :bg (theme-color :separator))) + (cl-tty.backend:draw-text fb (1- x) row " " nil (theme-color :separator))) ;; Focus panel (cl-tty.backend:draw-text fb (1+ x) (incf y) " FOCUS" (theme-color :accent) nil) (incf y)