fix: draw input after separator so cursor stays at input line

The render order was: view-chat → view-input → draw-separator.
After the separator draw, the cursor ended up at row h-4 (the
separator line). Typed characters echoed by the terminal appeared
on the separator line, above the > prompt. Swapped so the input
line is drawn last: view-chat → draw-separator → view-input.
This commit is contained in:
2026-05-14 12:48:01 -04:00
parent c0d0ddfeec
commit d5b4c8c8f0

View File

@@ -922,9 +922,10 @@ Event handlers + daemon I/O + main loop.
(cl-tty.backend:backend-clear be) (cl-tty.backend:backend-clear be)
(view-status be w h) (view-status be w h)
(view-chat be w h) (view-chat be w h)
(view-input be w h) ;; Draw separator line above input
(cl-tty.backend:draw-text be 0 (- h 4) (make-string w :initial-element #\─) (cl-tty.backend:draw-text be 0 (- h 4) (make-string w :initial-element #\─)
(theme-color :separator) nil) (theme-color :separator) nil)
(view-input be w h)
(loop while (st :running) do (loop while (st :running) do
(dolist (ev (drain-queue)) (dolist (ev (drain-queue))
(cond (cond
@@ -967,13 +968,13 @@ Event handlers + daemon I/O + main loop.
(when (or (first (st :dirty)) (second (st :dirty)) (third (st :dirty))) (when (or (first (st :dirty)) (second (st :dirty)) (third (st :dirty)))
(cl-tty.backend:backend-clear be) (cl-tty.backend:backend-clear be)
(view-status be w h) (view-status be w h)
(view-chat be w h) (view-chat be w h)
(view-input be w h) ;; Draw separator line above input
;; Draw separator line above input (cl-tty.backend:draw-text be 0 (- h 4) (make-string w :initial-element #\─)
(cl-tty.backend:draw-text be 0 (- h 4) (make-string w :initial-element #\─) (theme-color :separator) nil)
(theme-color :separator) nil) (view-input be w h)
(when (and (st :sidebar-visible) (>= w 120)) (when (and (st :sidebar-visible) (>= w 120))
(view-sidebar be w h)) (view-sidebar be w h))
(setf (st :dirty) (list nil nil nil))) (setf (st :dirty) (list nil nil nil)))
(let ((ds (st :dialog-stack))) (let ((ds (st :dialog-stack)))
(when ds (when ds