From 74621cffd21b05f033c849416d40066993bbccf4 Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Thu, 14 May 2026 15:48:34 -0400 Subject: [PATCH] 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 --- org/channel-tui-view.org | 10 ++++++---- passepartout | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/org/channel-tui-view.org b/org/channel-tui-view.org index a554ceb..e1caf4c 100644 --- a/org/channel-tui-view.org +++ b/org/channel-tui-view.org @@ -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 diff --git a/passepartout b/passepartout index 86dbe90..0e08662 100755 --- a/passepartout +++ b/passepartout @@ -412,7 +412,7 @@ LISPEOF export MY_TERM_ROWS="${ts%% *}" MY_TERM_COLS="${ts##* }" # Set character-at-a-time mode BEFORE SBCL starts # (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 find ~/.cache/common-lisp -name "*.fasl" -path "*cl-tty*" -delete 2>/dev/null exec sbcl --noinform --load /tmp/tui-load.lisp