fix: disable flow control (-ixon) for Ctrl+Q, constrain prompt/hint to chat-w
- Added -ixon to stty so Ctrl+Q (XON byte) isn't swallowed by the terminal driver and reaches the TUI as :CTRL-Q - view-input now truncates the prompt (> prefix + visible text) to chat-w - 2 characters, and the hint to chat-w characters, so neither extends into the sidebar area
This commit is contained in:
@@ -222,12 +222,14 @@ Returns a list of strings, one per line."
|
|||||||
(h (or (and (numberp h) (> h 0) h) 24))
|
(h (or (and (numberp h) (> h 0) h) 24))
|
||||||
(sidebar-w (if (and (st :sidebar-visible) (>= w 60)) (or (st :sidebar-width) 30) 0))
|
(sidebar-w (if (and (st :sidebar-visible) (>= w 60)) (or (st :sidebar-width) 30) 0))
|
||||||
(chat-w (- w sidebar-w))
|
(chat-w (- w sidebar-w))
|
||||||
|
(prompt-w (- chat-w 2)) ; leave room for "> "
|
||||||
(text (input-string))
|
(text (input-string))
|
||||||
(pos (or (st :cursor-pos) 0))
|
(pos (or (st :cursor-pos) 0))
|
||||||
(display-start (max 0 (- pos (1- chat-w))))
|
(display-start (max 0 (- pos (1- prompt-w))))
|
||||||
(visible (subseq text display-start (min (length text) (+ display-start chat-w)))))
|
(visible (subseq text display-start (min (length text) (+ display-start prompt-w))))
|
||||||
(cl-tty.backend:draw-text fb 0 (- h 2) (format nil " Ctrl+P palette | Up/Dn history | Tab complete")
|
(hint " Ctrl+P palette | Up/Dn history | Tab complete")
|
||||||
(theme-color :hint) nil)
|
(hint (if (> (length hint) chat-w) (subseq hint 0 chat-w) hint)))
|
||||||
|
(cl-tty.backend:draw-text fb 0 (- h 2) hint (theme-color :hint) nil)
|
||||||
(cl-tty.backend:draw-text fb 0 (- h 3) (format nil "> ~a" visible) (theme-color :input-fg) nil)))
|
(cl-tty.backend:draw-text fb 0 (- h 3) (format nil "> ~a" visible) (theme-color :input-fg) nil)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ LISPEOF
|
|||||||
export MY_TERM_ROWS="${ts%% *}" MY_TERM_COLS="${ts##* }"
|
export MY_TERM_ROWS="${ts%% *}" MY_TERM_COLS="${ts##* }"
|
||||||
# Set character-at-a-time mode BEFORE SBCL starts
|
# Set character-at-a-time mode BEFORE SBCL starts
|
||||||
# (uiop:run-program inside SBCL can't access the terminal)
|
# (uiop:run-program inside SBCL can't access the terminal)
|
||||||
stty -icanon -echo 2>/dev/null
|
stty -icanon -echo -ixon 2>/dev/null
|
||||||
# Clear stale cl-tty cache to ensure latest backend-size fixes
|
# Clear stale cl-tty cache to ensure latest backend-size fixes
|
||||||
find ~/.cache/common-lisp -name "*.fasl" -path "*cl-tty*" -delete 2>/dev/null
|
find ~/.cache/common-lisp -name "*.fasl" -path "*cl-tty*" -delete 2>/dev/null
|
||||||
exec sbcl --noinform --load /tmp/tui-load.lisp
|
exec sbcl --noinform --load /tmp/tui-load.lisp
|
||||||
|
|||||||
Reference in New Issue
Block a user