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))
|
||||
(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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user