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:
2026-05-14 15:48:34 -04:00
parent 2ce8d9d886
commit 74621cffd2
2 changed files with 7 additions and 5 deletions

View File

@@ -222,12 +222,14 @@ Returns a list of strings, one per line."
(h (or (and (numberp h) (> h 0) h) 24))
(sidebar-w (if (and (st :sidebar-visible) (>= w 60)) (or (st :sidebar-width) 30) 0))
(chat-w (- w sidebar-w))
(prompt-w (- chat-w 2)) ; leave room for "> "
(text (input-string))
(pos (or (st :cursor-pos) 0))
(display-start (max 0 (- pos (1- chat-w))))
(visible (subseq text display-start (min (length text) (+ display-start chat-w)))))
(cl-tty.backend:draw-text fb 0 (- h 2) (format nil " Ctrl+P palette | Up/Dn history | Tab complete")
(theme-color :hint) nil)
(display-start (max 0 (- pos (1- prompt-w))))
(visible (subseq text display-start (min (length text) (+ display-start prompt-w))))
(hint " Ctrl+P palette | Up/Dn history | Tab complete")
(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)))
#+end_src