v1.0.0: TUI support — resize events, with-terminal macro

This commit is contained in:
Hermes Agent
2026-05-12 20:32:37 +00:00
parent 84e8482fec
commit 38ee561625
3 changed files with 3 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ Called before SIGTSTP or similar suspension. Application should redraw after res
Called after SIGCONT or similar resume. Re-enables raw mode and backend features.")
(:method ((b backend)) (values)))
(defmacro with-terminal ((backend-var &optional (cols-var (gensym)) (rows-var (gensym)))
(defmacro with-terminal ((backend-var &optional cols-var rows-var)
&body body)
"Execute BODY with a fully initialized terminal backend.
@@ -39,8 +39,8 @@ Example:
(c-sym (gensym "COLS"))
(r-sym (gensym "ROWS")))
`(let* ((,be-sym (detect-backend))
(,c-sym (nth-value 0 (backend-size ,be-sym)))
(,r-sym (nth-value 1 (backend-size ,be-sym))))
,@(when cols-var `((,c-sym (nth-value 0 (backend-size ,be-sym)))))
,@(when rows-var `((,r-sym (nth-value 1 (backend-size ,be-sym))))))
(initialize-backend ,be-sym)
(unwind-protect
(let ((,backend-var ,be-sym)

View File

@@ -186,7 +186,6 @@
(setf *terminal-resized-p* t))))
(defmethod read-event ((b cl-tty.backend:backend) &key timeout)
(declare (ignore b))
;; Check for pending terminal resize before reading input.
;; The SIGWINCH handler sets *terminal-resized-p* asynchronously.
(when *terminal-resized-p*