fix(tui): Correct input focus and cursor positioning
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
This commit is contained in:
@@ -74,9 +74,7 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro
|
||||
(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 Prompt
|
||||
(add-string input-win "> ")
|
||||
(refresh input-win)
|
||||
(setf (keypad-p input-win) t)
|
||||
|
||||
(loop while *is-running* do
|
||||
;; 1. Handle incoming messages
|
||||
@@ -99,7 +97,7 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro
|
||||
(refresh status-win)
|
||||
|
||||
;; 3. Handle Keyboard Input
|
||||
(let ((ch (get-char scr)))
|
||||
(let ((ch (get-char input-win)))
|
||||
(when ch
|
||||
(cond
|
||||
((eq ch #\Newline)
|
||||
@@ -114,11 +112,12 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro
|
||||
(when (> (length *input-buffer*) 0)
|
||||
(decf (fill-pointer *input-buffer*))))
|
||||
((characterp ch)
|
||||
(vector-push-extend ch *input-buffer*)))))
|
||||
|
||||
(clear input-win)
|
||||
(add-string input-win (concatenate 'string "> " (coerce *input-buffer* 'string)))
|
||||
(refresh input-win)
|
||||
(vector-push-extend ch *input-buffer*))))
|
||||
|
||||
(clear input-win)
|
||||
(add-string input-win (concatenate 'string "> " (coerce *input-buffer* 'string)))
|
||||
(move input-win 0 (+ 2 (length *input-buffer*)))
|
||||
(refresh input-win))
|
||||
|
||||
(sleep 0.02))))
|
||||
(setf *is-running* nil)
|
||||
|
||||
@@ -61,9 +61,7 @@
|
||||
(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 Prompt
|
||||
(add-string input-win "> ")
|
||||
(refresh input-win)
|
||||
(setf (keypad-p input-win) t)
|
||||
|
||||
(loop while *is-running* do
|
||||
;; 1. Handle incoming messages
|
||||
@@ -86,7 +84,7 @@
|
||||
(refresh status-win)
|
||||
|
||||
;; 3. Handle Keyboard Input
|
||||
(let ((ch (get-char scr)))
|
||||
(let ((ch (get-char input-win)))
|
||||
(when ch
|
||||
(cond
|
||||
((eq ch #\Newline)
|
||||
@@ -101,11 +99,12 @@
|
||||
(when (> (length *input-buffer*) 0)
|
||||
(decf (fill-pointer *input-buffer*))))
|
||||
((characterp ch)
|
||||
(vector-push-extend ch *input-buffer*)))))
|
||||
|
||||
(clear input-win)
|
||||
(add-string input-win (concatenate 'string "> " (coerce *input-buffer* 'string)))
|
||||
(refresh input-win)
|
||||
(vector-push-extend ch *input-buffer*))))
|
||||
|
||||
(clear input-win)
|
||||
(add-string input-win (concatenate 'string "> " (coerce *input-buffer* 'string)))
|
||||
(move input-win 0 (+ 2 (length *input-buffer*)))
|
||||
(refresh input-win))
|
||||
|
||||
(sleep 0.02))))
|
||||
(setf *is-running* nil)
|
||||
|
||||
Reference in New Issue
Block a user