diff --git a/org/channel-tui-main.org b/org/channel-tui-main.org index 2ebb734..a96403d 100644 --- a/org/channel-tui-main.org +++ b/org/channel-tui-main.org @@ -910,12 +910,8 @@ Event handlers + daemon I/O + main loop. ;; breaks read on fd 0 in this SBCL environment, but -echo alone ;; works. A cat subprocess inherits the terminal and provides ;; bytes through a pipe that SBCL reads reliably. - ;; Enable character-at-a-time input (-icanon) so Ctrl+P/B - ;; arrive as individual bytes instead of being buffered. - ;; SBCL now reads from cat's pipe, not directly from fd 0, - ;; so -icanon doesn't trigger the SBCL read block issue. - (uiop:run-program '("stty" "-icanon" "-echo") - :output nil :ignore-error-status t) + ;; stty -icanon -echo is set by the bash script before exec sbcl. + ;; A cat subprocess reads keyboard input from the terminal. (let* ((cat-proc (uiop:launch-program '("cat") :output :stream :input :interactive diff --git a/passepartout b/passepartout index 3febe3f..86dbe90 100755 --- a/passepartout +++ b/passepartout @@ -410,6 +410,9 @@ LISPEOF # (SBCL strips COLUMNS/LINES but leaves MY_* alone). ts=$(stty size 2>/dev/null) 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 # 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