fix(tui): Redraw status-win conditionally and non-block input-win to prevent cursor flickering
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
This commit is contained in:
@@ -72,9 +72,11 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro
|
|||||||
(w (width scr))
|
(w (width scr))
|
||||||
(chat-win (make-instance 'window :height (- h 2) :width w :position (list 0 0)))
|
(chat-win (make-instance 'window :height (- h 2) :width w :position (list 0 0)))
|
||||||
(status-win (make-instance 'window :height 1 :width w :position (list (- h 2) 0)))
|
(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))))
|
(input-win (make-instance 'window :height 1 :width w :position (list (- h 1) 0)))
|
||||||
|
(last-status nil))
|
||||||
|
|
||||||
(setf (function-keys-enabled-p input-win) t)
|
(setf (function-keys-enabled-p input-win) t)
|
||||||
|
(setf (input-blocking input-win) nil)
|
||||||
|
|
||||||
(loop while *is-running* do
|
(loop while *is-running* do
|
||||||
;; 1. Handle incoming messages
|
;; 1. Handle incoming messages
|
||||||
@@ -92,9 +94,11 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro
|
|||||||
(refresh chat-win)))
|
(refresh chat-win)))
|
||||||
|
|
||||||
;; 2. Render Status Bar
|
;; 2. Render Status Bar
|
||||||
(clear status-win)
|
(unless (equal *status-text* last-status)
|
||||||
(add-string status-win *status-text* :attributes '(:reverse))
|
(clear status-win)
|
||||||
(refresh status-win)
|
(add-string status-win *status-text* :attributes '(:reverse))
|
||||||
|
(refresh status-win)
|
||||||
|
(setf last-status *status-text*))
|
||||||
|
|
||||||
;; 3. Handle Keyboard Input
|
;; 3. Handle Keyboard Input
|
||||||
(let ((ch (get-char input-win)))
|
(let ((ch (get-char input-win)))
|
||||||
|
|||||||
@@ -59,9 +59,11 @@
|
|||||||
(w (width scr))
|
(w (width scr))
|
||||||
(chat-win (make-instance 'window :height (- h 2) :width w :position (list 0 0)))
|
(chat-win (make-instance 'window :height (- h 2) :width w :position (list 0 0)))
|
||||||
(status-win (make-instance 'window :height 1 :width w :position (list (- h 2) 0)))
|
(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))))
|
(input-win (make-instance 'window :height 1 :width w :position (list (- h 1) 0)))
|
||||||
|
(last-status nil))
|
||||||
|
|
||||||
(setf (function-keys-enabled-p input-win) t)
|
(setf (function-keys-enabled-p input-win) t)
|
||||||
|
(setf (input-blocking input-win) nil)
|
||||||
|
|
||||||
(loop while *is-running* do
|
(loop while *is-running* do
|
||||||
;; 1. Handle incoming messages
|
;; 1. Handle incoming messages
|
||||||
@@ -79,9 +81,11 @@
|
|||||||
(refresh chat-win)))
|
(refresh chat-win)))
|
||||||
|
|
||||||
;; 2. Render Status Bar
|
;; 2. Render Status Bar
|
||||||
(clear status-win)
|
(unless (equal *status-text* last-status)
|
||||||
(add-string status-win *status-text* :attributes '(:reverse))
|
(clear status-win)
|
||||||
(refresh status-win)
|
(add-string status-win *status-text* :attributes '(:reverse))
|
||||||
|
(refresh status-win)
|
||||||
|
(setf last-status *status-text*))
|
||||||
|
|
||||||
;; 3. Handle Keyboard Input
|
;; 3. Handle Keyboard Input
|
||||||
(let ((ch (get-char input-win)))
|
(let ((ch (get-char input-win)))
|
||||||
|
|||||||
Reference in New Issue
Block a user