From c1d5c14412b8c63ec334505f19af5177947ff90a Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Sun, 19 Apr 2026 12:33:02 -0400 Subject: [PATCH] fix(tui): Force screen refresh and initialize input prompt --- literate/tui-client.org | 8 +++++++- src/tui-client.lisp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/literate/tui-client.org b/literate/tui-client.org index ec16970..07b3c27 100644 --- a/literate/tui-client.org +++ b/literate/tui-client.org @@ -86,6 +86,11 @@ The OpenCortex TUI Client is a standalone Common Lisp executable providing a ric (status-win (make-instance 'window :height 1 :width w :position (list (- h 2) 0))) (input-win (make-instance 'window :height 1 :width w :position (list (- h 1) 0)))) + ;; Initial Render + (add-string input-win "> ") + (refresh input-win) + + (loop while *is-running* do ;; Handle incoming messages (let ((new-msgs (dequeue-msgs))) @@ -126,7 +131,8 @@ The OpenCortex TUI Client is a standalone Common Lisp executable providing a ric (clear input-win) (add-string input-win (concatenate 'string "> " (coerce *input-buffer* 'string))) - (refresh input-win))) + (refresh input-win)) + (refresh scr) (sleep 0.02)))) (setf *is-running* nil) diff --git a/src/tui-client.lisp b/src/tui-client.lisp index 09f3743..66657be 100644 --- a/src/tui-client.lisp +++ b/src/tui-client.lisp @@ -62,6 +62,11 @@ (status-win (make-instance 'window :height 1 :width w :position (list (- h 2) 0))) (input-win (make-instance 'window :height 1 :width w :position (list (- h 1) 0)))) + ;; Initial Render + (add-string input-win "> ") + (refresh input-win) + + (loop while *is-running* do ;; Handle incoming messages (let ((new-msgs (dequeue-msgs))) @@ -102,7 +107,8 @@ (clear input-win) (add-string input-win (concatenate 'string "> " (coerce *input-buffer* 'string))) - (refresh input-win))) + (refresh input-win)) + (refresh scr) (sleep 0.02)))) (setf *is-running* nil)