From d5b4c8c8f0a39d39e53aad0f3fd88f50b96cb170 Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Thu, 14 May 2026 12:48:01 -0400 Subject: [PATCH] fix: draw input after separator so cursor stays at input line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- org/channel-tui-main.org | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/org/channel-tui-main.org b/org/channel-tui-main.org index 4e08192..a00a9dc 100644 --- a/org/channel-tui-main.org +++ b/org/channel-tui-main.org @@ -922,9 +922,10 @@ Event handlers + daemon I/O + main loop. (cl-tty.backend:backend-clear be) (view-status 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 #\─) (theme-color :separator) nil) + (view-input be w h) (loop while (st :running) do (dolist (ev (drain-queue)) (cond @@ -967,13 +968,13 @@ Event handlers + daemon I/O + main loop. (when (or (first (st :dirty)) (second (st :dirty)) (third (st :dirty))) (cl-tty.backend:backend-clear be) (view-status 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 #\─) - (theme-color :separator) nil) - (when (and (st :sidebar-visible) (>= w 120)) - (view-sidebar be w h)) + (view-chat be w h) + ;; Draw separator line above input + (cl-tty.backend:draw-text be 0 (- h 4) (make-string w :initial-element #\─) + (theme-color :separator) nil) + (view-input be w h) + (when (and (st :sidebar-visible) (>= w 120)) + (view-sidebar be w h)) (setf (st :dirty) (list nil nil nil))) (let ((ds (st :dialog-stack))) (when ds